summaryrefslogtreecommitdiff
authorzecke <zecke>2003-05-12 13:07:37 (UTC)
committer zecke <zecke>2003-05-12 13:07:37 (UTC)
commit4765c92ba3dcbd829cb2adde4a097dfe6283d7cc (patch) (unidiff)
tree7a13062058737af1564863f9caec692f145fdfaa
parent65a043f4ac4b43967947c1e8d99c629bb993f065 (diff)
downloadopie-4765c92ba3dcbd829cb2adde4a097dfe6283d7cc.zip
opie-4765c92ba3dcbd829cb2adde4a097dfe6283d7cc.tar.gz
opie-4765c92ba3dcbd829cb2adde4a097dfe6283d7cc.tar.bz2
Hospital Hacking Session
Install libopie.qm make apps fully translatable... refactor installing trans into a method instead of having the same code copy and pasted three times
Diffstat (more/less context) (ignore 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 )
605 605
606 QTranslator * trans; 606 installTranslation( lang + "/libopie.qm");
607 QString tfn; 607 installTranslation( lang + "/libqpe.qm" );
608 installTranslation( lang + "/" + d->appName + ".qm" );
608 609
609 trans = new QTranslator( this );
610 tfn = qpeDir() + "/i18n/" + lang + "/libqpe.qm";
611 if ( trans->load( tfn ) )
612 installTranslator( trans );
613 else
614 delete trans;
615
616 trans = new QTranslator( this );
617 tfn = qpeDir() + "/i18n/" + lang + "/" + d->appName + ".qm";
618 if ( trans->load( tfn ) )
619 installTranslator( trans );
620 else
621 delete trans;
622 610
@@ -1729,2 +1717,14 @@ void QPEApplication::tryQuit()
1729 \internal 1717 \internal
1718*/
1719void QPEApplication::installTranslation( const QString& baseName ) {
1720 QTranslator* trans = new QTranslator(this);
1721 QString tfn = qpeDir() + "/i18n/"+baseName;
1722 if ( trans->load( tfn ) )
1723 installTranslator( trans );
1724 else
1725 delete trans;
1726}
1727
1728/*!
1729 \internal
1730 User initiated quit. Makes the window 'Go Away'. If preloaded this means 1730 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:
124private: 124private:
125#ifndef QT_NO_TRANSLATION
126 void installTranslation( const QString& baseName );
127#endif
125 void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); 128 void mapToDefaultAction( QWSKeyEvent *ke, int defKey );