summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-02-04 22:14:18 (UTC)
committer kergoth <kergoth>2002-02-04 22:14:18 (UTC)
commitd46cb220a09b41312d86bb33573940d3dcba2588 (patch) (side-by-side diff)
tree6aacb1589d5de2ca908d067f99ba64dc608a6fa5
parent500e2f0cdbe82035516b7a1c576e08e0b2ad72b3 (diff)
downloadopie-d46cb220a09b41312d86bb33573940d3dcba2588.zip
opie-d46cb220a09b41312d86bb33573940d3dcba2588.tar.gz
opie-d46cb220a09b41312d86bb33573940d3dcba2588.tar.bz2
latest qtopia merge as of 20020204.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--library/global.cpp49
-rw-r--r--library/qpeapplication.cpp38
-rwxr-xr-xmkipks2
-rw-r--r--noncore/games/minesweep/Makefile.in18
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
@@ -19,2 +19,3 @@
**********************************************************************/
+#define QTOPIA_INTERNAL_LANGLIST
#include <qpe/qpedebug.h>
@@ -172,8 +173,14 @@ const QDawg& Global::fixedDawg()
QString dawgfilename = dictDir() + "/dawg";
- QString lang = getenv( "LANG" );
+ QString words_lang;
+ QStringList langs = Global::languageList();
+ for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) {
+ QString lang = *it;
+ words_lang = dictDir() + "/words." + lang;
QString dawgfilename_lang = dawgfilename + "." + lang;
- QString words_lang = dictDir() + "/words." + lang;
if ( QFile::exists(dawgfilename_lang) ||
- QFile::exists(words_lang) )
+ QFile::exists(words_lang) ) {
dawgfilename = dawgfilename_lang;
+ break;
+ }
+ }
QFile dawgfile(dawgfilename);
@@ -641,2 +648,38 @@ void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter)
+QStringList Global::languageList()
+{
+ QString lang = getenv("LANG");
+ QStringList langs;
+ langs.append(lang);
+ int i = lang.find(".");
+ if ( i > 0 )
+ lang = lang.left( i );
+ i = lang.find( "_" );
+ if ( i > 0 )
+ langs.append(lang.left(i));
+ return langs;
+}
+
+QStringList Global::helpPath()
+{
+ QStringList path;
+ QStringList langs = Global::languageList();
+ for (QStringList::ConstIterator it = langs.fromLast(); it!=langs.end(); --it) {
+ QString lang = *it;
+ if ( !lang.isEmpty() )
+ path += QPEApplication::qpeDir() + "/help/" + lang + "/html";
+ }
+ path += QPEApplication::qpeDir() + "/pics";
+ path += QPEApplication::qpeDir() + "/help/en/html";
+ path += QPEApplication::qpeDir() + "/docs";
+ QString dir = QDir::current().canonicalPath();
+ if ( dir == "/" )
+ dir += "/docs";
+ else {
+ path += dir + "/../pics";
+ dir += "/../docs";
+ path += dir;
+ }
+ return path;
+}
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 70ffec1..4dbfbd8 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -21,2 +21,3 @@
**********************************************************************/
+#define QTOPIA_INTERNAL_LANGLIST
#include <stdlib.h>
@@ -139,18 +140,3 @@ public:
{
- QStringList path;
- QString lang = getenv("LANG");
- if ( !lang.isEmpty() )
- path += QPEApplication::qpeDir() + "/help/" + lang + "/html";
- path += QPEApplication::qpeDir() + "/pics";
- path += QPEApplication::qpeDir() + "/help/en/html";
- path += QPEApplication::qpeDir() + "/docs";
- QString dir = QDir::current().canonicalPath();
- if ( dir == "/" )
- dir += "/docs";
- else {
- path += dir + "/../pics";
- dir += "/../docs";
- path += dir;
- }
- setFilePath( path );
+ setFilePath( Global::helpPath() );
setExtensionType("html","text/html;charset=UTF-8");
@@ -539,15 +525,11 @@ QPEApplication::QPEApplication( int& argc, char **argv, Type t )
#ifndef QT_NO_TRANSLATION
- char *l = getenv( "LANG" );
- QString lang;
- if ( l ) {
- lang = l;
+ QStringList langs = Global::languageList();
+ for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) {
+ QString lang = *it;
- /*
- Config config("qpe");
- config.setGroup( "Appearance" );
- lang = config.readEntry( "Language", lang );
- */
+ QTranslator * trans;
+ QString tfn;
- QTranslator * trans = new QTranslator(this);
- QString tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm";
+ trans = new QTranslator(this);
+ tfn = qpeDir()+"/i18n/"+lang+"/libqpe.qm";
if ( trans->load( tfn ))
@@ -558,3 +540,3 @@ QPEApplication::QPEApplication( int& argc, char **argv, Type t )
trans = new QTranslator(this);
- tfn = qpeDir()+"/i18n/"+lang+"/libqpe.qm";
+ tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm";
if ( trans->load( tfn ))
diff --git a/mkipks b/mkipks
index dedb060..d44f074 100755
--- a/mkipks
+++ b/mkipks
@@ -178,3 +178,3 @@ do
/bin/ls $RPMFILES >>$SPEC
- rpm -bb $SPEC --target $ARCH-unknown-linux
+ rpm -bb --target $ARCH-unknown-linux $SPEC
# rm $SPEC
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
@@ -71,4 +71,6 @@ moc: $(SRCMOC)
-tmake:
- tmake minesweep.pro
+tmake: Makefile.in
+
+Makefile.in: minesweep.pro
+ tmake minesweep.pro -o Makefile.in
@@ -107,3 +109,3 @@ main.o: main.cpp \
minesweep.h \
- $(OPIEDIR)/include/qpe/qpeapplication.h
+ /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/qpeapplication.h
@@ -111,3 +113,3 @@ minefield.o: minefield.cpp \
minefield.h \
- $(OPIEDIR)/include/qpe/config.h
+ /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/config.h
@@ -116,6 +118,6 @@ minesweep.o: minesweep.cpp \
minefield.h \
- $(OPIEDIR)/include/qpe/resource.h \
- $(OPIEDIR)/include/qpe/config.h \
- $(OPIEDIR)/include/qpe/qpetoolbar.h \
- $(OPIEDIR)/include/qpe/qpemenubar.h
+ /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/resource.h \
+ /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/config.h \
+ /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/qpetoolbar.h \
+ /home/kergoth/roms/openzaurus/buildroot-oz/build/opie/include/qpe/qpemenubar.h