-rw-r--r-- | library/qpeapplication.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index e5da48c..f4db1ab 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -598,32 +598,20 @@ QPEApplication::QPEApplication( int & argc, char **argv, Type t ) // qwsSetDecoration( new QPEDecoration() ); #ifndef QT_NO_TRANSLATION QStringList langs = Global::languageList(); for ( QStringList::ConstIterator it = langs.begin(); it != langs.end(); ++it ) { QString lang = *it; - QTranslator * trans; - QString tfn; + installTranslation( lang + "/libopie.qm"); + installTranslation( lang + "/libqpe.qm" ); + installTranslation( 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 + "/" + d->appName + ".qm"; - if ( trans->load( tfn ) ) - installTranslator( trans ); - else - delete trans; //###language/font hack; should look it up somewhere #ifdef QWS if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) { QFont fn = FontManager::unicodeFont( FontManager::Proportional ); setFont( fn ); } @@ -1722,16 +1710,28 @@ void QPEApplication::tryQuit() #endif processEvents(); quit(); } /*! \internal +*/ +void QPEApplication::installTranslation( const QString& baseName ) { + QTranslator* trans = new QTranslator(this); + QString tfn = qpeDir() + "/i18n/"+baseName; + if ( trans->load( tfn ) ) + installTranslator( trans ); + else + delete trans; +} + +/*! + \internal User initiated quit. Makes the window 'Go Away'. If preloaded this means hiding the window. If not it means quitting the application. As this is user initiated we don't need to check state. */ void QPEApplication::hideOrQuit() { processEvents(); |