summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--library/qpeapplication.cpp30
-rw-r--r--library/qpeapplication.h3
2 files changed, 18 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
@@ -605,18 +605,6 @@ QPEApplication::QPEApplication( int & argc, char **argv, Type t )
- 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;
@@ -1729,2 +1717,14 @@ void QPEApplication::tryQuit()
\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
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 0bad8b7..e35c008 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -124,2 +124,5 @@ protected:
private:
+#ifndef QT_NO_TRANSLATION
+ void installTranslation( const QString& baseName );
+#endif
void mapToDefaultAction( QWSKeyEvent *ke, int defKey );