-rw-r--r-- | library/global.cpp | 49 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 38 | ||||
-rwxr-xr-x | mkipks | 2 | ||||
-rw-r--r-- | noncore/games/minesweep/Makefile.in | 18 |
4 files changed, 67 insertions, 40 deletions
diff --git a/library/global.cpp b/library/global.cpp index fd7579a..dd15eb7 100644 --- a/library/global.cpp +++ b/library/global.cpp | |||
@@ -14,12 +14,13 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #define QTOPIA_INTERNAL_LANGLIST | ||
20 | #include <qpe/qpedebug.h> | 21 | #include <qpe/qpedebug.h> |
21 | #include <qpe/global.h> | 22 | #include <qpe/global.h> |
22 | #include <qpe/qdawg.h> | 23 | #include <qpe/qdawg.h> |
23 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
25 | #include <qpe/storage.h> | 26 | #include <qpe/storage.h> |
@@ -167,18 +168,24 @@ const QDawg& Global::fixedDawg() | |||
167 | if ( !fixed_dawg ) { | 168 | if ( !fixed_dawg ) { |
168 | if ( !docDirCreated ) | 169 | if ( !docDirCreated ) |
169 | createDocDir(); | 170 | createDocDir(); |
170 | 171 | ||
171 | fixed_dawg = new QDawg; | 172 | fixed_dawg = new QDawg; |
172 | QString dawgfilename = dictDir() + "/dawg"; | 173 | QString dawgfilename = dictDir() + "/dawg"; |
173 | QString lang = getenv( "LANG" ); | 174 | QString words_lang; |
175 | QStringList langs = Global::languageList(); | ||
176 | for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) { | ||
177 | QString lang = *it; | ||
178 | words_lang = dictDir() + "/words." + lang; | ||
174 | QString dawgfilename_lang = dawgfilename + "." + lang; | 179 | QString dawgfilename_lang = dawgfilename + "." + lang; |
175 | QString words_lang = dictDir() + "/words." + lang; | ||
176 | if ( QFile::exists(dawgfilename_lang) || | 180 | if ( QFile::exists(dawgfilename_lang) || |
177 | QFile::exists(words_lang) ) | 181 | QFile::exists(words_lang) ) { |
178 | dawgfilename = dawgfilename_lang; | 182 | dawgfilename = dawgfilename_lang; |
183 | break; | ||
184 | } | ||
185 | } | ||
179 | QFile dawgfile(dawgfilename); | 186 | QFile dawgfile(dawgfilename); |
180 | 187 | ||
181 | if ( !dawgfile.exists() ) { | 188 | if ( !dawgfile.exists() ) { |
182 | QString fn = dictDir() + "/words"; | 189 | QString fn = dictDir() + "/words"; |
183 | if ( QFile::exists(words_lang) ) | 190 | if ( QFile::exists(words_lang) ) |
184 | fn = words_lang; | 191 | fn = words_lang; |
@@ -636,9 +643,45 @@ void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) | |||
636 | DocLnkSet ide( path, mimefilter ); | 643 | DocLnkSet ide( path, mimefilter ); |
637 | folder->appendFrom(ide); | 644 | folder->appendFrom(ide); |
638 | } | 645 | } |
639 | } | 646 | } |
640 | } | 647 | } |
641 | 648 | ||
649 | QStringList Global::languageList() | ||
650 | { | ||
651 | QString lang = getenv("LANG"); | ||
652 | QStringList langs; | ||
653 | langs.append(lang); | ||
654 | int i = lang.find("."); | ||
655 | if ( i > 0 ) | ||
656 | lang = lang.left( i ); | ||
657 | i = lang.find( "_" ); | ||
658 | if ( i > 0 ) | ||
659 | langs.append(lang.left(i)); | ||
660 | return langs; | ||
661 | } | ||
662 | |||
663 | QStringList Global::helpPath() | ||
664 | { | ||
665 | QStringList path; | ||
666 | QStringList langs = Global::languageList(); | ||
667 | for (QStringList::ConstIterator it = langs.fromLast(); it!=langs.end(); --it) { | ||
668 | QString lang = *it; | ||
669 | if ( !lang.isEmpty() ) | ||
670 | path += QPEApplication::qpeDir() + "/help/" + lang + "/html"; | ||
671 | } | ||
672 | path += QPEApplication::qpeDir() + "/pics"; | ||
673 | path += QPEApplication::qpeDir() + "/help/en/html"; | ||
674 | path += QPEApplication::qpeDir() + "/docs"; | ||
675 | QString dir = QDir::current().canonicalPath(); | ||
676 | if ( dir == "/" ) | ||
677 | dir += "/docs"; | ||
678 | else { | ||
679 | path += dir + "/../pics"; | ||
680 | dir += "/../docs"; | ||
681 | path += dir; | ||
682 | } | ||
683 | return path; | ||
684 | } | ||
642 | 685 | ||
643 | 686 | ||
644 | #include "global.moc" | 687 | #include "global.moc" |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 70ffec1..4dbfbd8 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -16,12 +16,13 @@ | |||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | ** $Id$ | 19 | ** $Id$ |
20 | ** | 20 | ** |
21 | **********************************************************************/ | 21 | **********************************************************************/ |
22 | #define QTOPIA_INTERNAL_LANGLIST | ||
22 | #include <stdlib.h> | 23 | #include <stdlib.h> |
23 | #include <unistd.h> | 24 | #include <unistd.h> |
24 | #include <qfile.h> | 25 | #include <qfile.h> |
25 | #ifdef Q_WS_QWS | 26 | #ifdef Q_WS_QWS |
26 | #ifndef QT_NO_COP | 27 | #ifndef QT_NO_COP |
27 | #if QT_VERSION <= 231 | 28 | #if QT_VERSION <= 231 |
@@ -134,28 +135,13 @@ public: | |||
134 | }; | 135 | }; |
135 | 136 | ||
136 | class ResourceMimeFactory : public QMimeSourceFactory { | 137 | class ResourceMimeFactory : public QMimeSourceFactory { |
137 | public: | 138 | public: |
138 | ResourceMimeFactory() | 139 | ResourceMimeFactory() |
139 | { | 140 | { |
140 | QStringList path; | 141 | setFilePath( Global::helpPath() ); |
141 | QString lang = getenv("LANG"); | ||
142 | if ( !lang.isEmpty() ) | ||
143 | path += QPEApplication::qpeDir() + "/help/" + lang + "/html"; | ||
144 | path += QPEApplication::qpeDir() + "/pics"; | ||
145 | path += QPEApplication::qpeDir() + "/help/en/html"; | ||
146 | path += QPEApplication::qpeDir() + "/docs"; | ||
147 | QString dir = QDir::current().canonicalPath(); | ||
148 | if ( dir == "/" ) | ||
149 | dir += "/docs"; | ||
150 | else { | ||
151 | path += dir + "/../pics"; | ||
152 | dir += "/../docs"; | ||
153 | path += dir; | ||
154 | } | ||
155 | setFilePath( path ); | ||
156 | setExtensionType("html","text/html;charset=UTF-8"); | 142 | setExtensionType("html","text/html;charset=UTF-8"); |
157 | } | 143 | } |
158 | 144 | ||
159 | const QMimeSource* data(const QString& abs_name) const | 145 | const QMimeSource* data(const QString& abs_name) const |
160 | { | 146 | { |
161 | const QMimeSource* r = QMimeSourceFactory::data(abs_name); | 147 | const QMimeSource* r = QMimeSourceFactory::data(abs_name); |
@@ -534,32 +520,28 @@ QPEApplication::QPEApplication( int& argc, char **argv, Type t ) | |||
534 | 520 | ||
535 | #endif | 521 | #endif |
536 | 522 | ||
537 | qwsSetDecoration( new QPEDecoration() ); | 523 | qwsSetDecoration( new QPEDecoration() ); |
538 | 524 | ||
539 | #ifndef QT_NO_TRANSLATION | 525 | #ifndef QT_NO_TRANSLATION |
540 | char *l = getenv( "LANG" ); | 526 | QStringList langs = Global::languageList(); |
541 | QString lang; | 527 | for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) { |
542 | if ( l ) { | 528 | QString lang = *it; |
543 | lang = l; | ||
544 | 529 | ||
545 | /* | 530 | QTranslator * trans; |
546 | Config config("qpe"); | 531 | QString tfn; |
547 | config.setGroup( "Appearance" ); | ||
548 | lang = config.readEntry( "Language", lang ); | ||
549 | */ | ||
550 | 532 | ||
551 | QTranslator * trans = new QTranslator(this); | 533 | trans = new QTranslator(this); |
552 | QString tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm"; | 534 | tfn = qpeDir()+"/i18n/"+lang+"/libqpe.qm"; |
553 | if ( trans->load( tfn )) | 535 | if ( trans->load( tfn )) |
554 | installTranslator( trans ); | 536 | installTranslator( trans ); |
555 | else | 537 | else |
556 | delete trans; | 538 | delete trans; |
557 | 539 | ||
558 | trans = new QTranslator(this); | 540 | trans = new QTranslator(this); |
559 | tfn = qpeDir()+"/i18n/"+lang+"/libqpe.qm"; | 541 | tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm"; |
560 | if ( trans->load( tfn )) | 542 | if ( trans->load( tfn )) |
561 | installTranslator( trans ); | 543 | installTranslator( trans ); |
562 | else | 544 | else |
563 | delete trans; | 545 | delete trans; |
564 | 546 | ||
565 | //###language/font hack; should look it up somewhere | 547 | //###language/font hack; should look it up somewhere |
@@ -173,13 +173,13 @@ do | |||
173 | 173 | ||
174 | echo >>$SPEC "%description" | 174 | echo >>$SPEC "%description" |
175 | sed -n -e '/^Description:/,$ p' $i | tail +2 >>$SPEC | 175 | sed -n -e '/^Description:/,$ p' $i | tail +2 >>$SPEC |
176 | echo >>$SPEC "%files" | 176 | echo >>$SPEC "%files" |
177 | echo >>$SPEC "%defattr(-,root,root)" | 177 | echo >>$SPEC "%defattr(-,root,root)" |
178 | /bin/ls $RPMFILES >>$SPEC | 178 | /bin/ls $RPMFILES >>$SPEC |
179 | rpm -bb $SPEC --target $ARCH-unknown-linux | 179 | rpm -bb --target $ARCH-unknown-linux $SPEC |
180 | # rm $SPEC | 180 | # rm $SPEC |
181 | elif [ -z "$IMAGEDIR" ] | 181 | elif [ -z "$IMAGEDIR" ] |
182 | then | 182 | then |
183 | #size=$(du -h -s $DATADIR | sed -e 's/[ ].*//') | 183 | #size=$(du -h -s $DATADIR | sed -e 's/[ ].*//') |
184 | size=$(mkfs.jffs2 -r $DATADIR | wc -c) | 184 | size=$(mkfs.jffs2 -r $DATADIR | wc -c) |
185 | echo "Package: $packagename" >$CTRLDIR/control | 185 | echo "Package: $packagename" >$CTRLDIR/control |
diff --git a/noncore/games/minesweep/Makefile.in b/noncore/games/minesweep/Makefile.in index 67ea94c..6df2608 100644 --- a/noncore/games/minesweep/Makefile.in +++ b/noncore/games/minesweep/Makefile.in | |||
@@ -66,14 +66,16 @@ all: $(DESTDIR)$(TARGET) | |||
66 | 66 | ||
67 | $(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) | 67 | $(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) |
68 | $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) | 68 | $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) |
69 | 69 | ||
70 | moc: $(SRCMOC) | 70 | moc: $(SRCMOC) |
71 | 71 | ||
72 | tmake: | 72 | tmake: Makefile.in |
73 | tmake minesweep.pro | 73 | |
74 | Makefile.in: minesweep.pro | ||
75 | tmake minesweep.pro -o Makefile.in | ||
74 | 76 | ||
75 | clean: | 77 | clean: |
76 | -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) | 78 | -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) |
77 | -rm -f *~ core | 79 | -rm -f *~ core |
78 | -rm -f allmoc.cpp | 80 | -rm -f allmoc.cpp |
79 | 81 | ||
@@ -102,25 +104,25 @@ REQUIRES= | |||
102 | 104 | ||
103 | 105 | ||
104 | ####### Compile | 106 | ####### Compile |
105 | 107 | ||
106 | main.o: main.cpp \ | 108 | main.o: main.cpp \ |
107 | minesweep.h \ | 109 | minesweep.h \ |
108 | $(OPIEDIR)/include/qpe/qpeapplication.h | 110 | /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/qpeapplication.h |
109 | 111 | ||
110 | minefield.o: minefield.cpp \ | 112 | minefield.o: minefield.cpp \ |
111 | minefield.h \ | 113 | minefield.h \ |
112 | $(OPIEDIR)/include/qpe/config.h | 114 | /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/config.h |
113 | 115 | ||
114 | minesweep.o: minesweep.cpp \ | 116 | minesweep.o: minesweep.cpp \ |
115 | minesweep.h \ | 117 | minesweep.h \ |
116 | minefield.h \ | 118 | minefield.h \ |
117 | $(OPIEDIR)/include/qpe/resource.h \ | 119 | /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/resource.h \ |
118 | $(OPIEDIR)/include/qpe/config.h \ | 120 | /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/config.h \ |
119 | $(OPIEDIR)/include/qpe/qpetoolbar.h \ | 121 | /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/qpetoolbar.h \ |
120 | $(OPIEDIR)/include/qpe/qpemenubar.h | 122 | /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/qpemenubar.h |
121 | 123 | ||
122 | moc_minefield.o: moc_minefield.cpp \ | 124 | moc_minefield.o: moc_minefield.cpp \ |
123 | minefield.h | 125 | minefield.h |
124 | 126 | ||
125 | moc_minesweep.o: moc_minesweep.cpp \ | 127 | moc_minesweep.o: moc_minesweep.cpp \ |
126 | minesweep.h | 128 | minesweep.h |