summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
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 /library/qpeapplication.cpp
parent500e2f0cdbe82035516b7a1c576e08e0b2ad72b3 (diff)
downloadopie-d46cb220a09b41312d86bb33573940d3dcba2588.zip
opie-d46cb220a09b41312d86bb33573940d3dcba2588.tar.gz
opie-d46cb220a09b41312d86bb33573940d3dcba2588.tar.bz2
latest qtopia merge as of 20020204.
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp40
1 files changed, 11 insertions, 29 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 70ffec1..4dbfbd8 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -19,6 +19,7 @@
** $Id$
**
**********************************************************************/
+#define QTOPIA_INTERNAL_LANGLIST
#include <stdlib.h>
#include <unistd.h>
#include <qfile.h>
@@ -137,22 +138,7 @@ class ResourceMimeFactory : public QMimeSourceFactory {
public:
ResourceMimeFactory()
{
- 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");
}
@@ -537,32 +523,28 @@ QPEApplication::QPEApplication( int& argc, char **argv, Type t )
qwsSetDecoration( new QPEDecoration() );
#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 ))
installTranslator( trans );
else
delete trans;
trans = new QTranslator(this);
- tfn = qpeDir()+"/i18n/"+lang+"/libqpe.qm";
+ tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm";
if ( trans->load( tfn ))
installTranslator( trans );
else
delete trans;
- //###language/font hack; should look it up somewhere
+ //###language/font hack; should look it up somewhere
if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) {
QFont fn = FontManager::unicodeFont( FontManager::Proportional );
setFont( fn );