author | sandman <sandman> | 2002-10-23 21:55:13 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-23 21:55:13 (UTC) |
commit | 3c9835537b2fdccab4c0f720a4d77a98ad8bba10 (patch) (unidiff) | |
tree | bedafdbcd4410bca7fe177e5ffeab982f81496bb /core/launcher/systray.cpp | |
parent | 482c5cfe8b3653888ba97716a1b29dae05200d70 (diff) | |
download | opie-3c9835537b2fdccab4c0f720a4d77a98ad8bba10.zip opie-3c9835537b2fdccab4c0f720a4d77a98ad8bba10.tar.gz opie-3c9835537b2fdccab4c0f720a4d77a98ad8bba10.tar.bz2 |
Fixed a translation bug regarding launcher applets, that got in when I
merged with Qtopia 1.6 (TT bug).
found by Héctor GarcíaÁlvarez <hector@disoft.es>, but I modified his patch,
since running the applet widget constructor *before* the QTranslator gets
installed seems like a bad idea.
-rw-r--r-- | core/launcher/systray.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index 406c662..4859e48 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp | |||
@@ -91,6 +91,7 @@ void SysTray::addApplets() | |||
91 | cfg.write(); | 91 | cfg.write(); |
92 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); | 92 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); |
93 | 93 | ||
94 | QString lang = getenv( "LANG" ); | ||
94 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; | 95 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; |
95 | QDir dir( path, "lib*.so" ); | 96 | QDir dir( path, "lib*.so" ); |
96 | QStringList list = dir.entryList(); | 97 | QStringList list = dir.entryList(); |
@@ -107,6 +108,14 @@ void SysTray::addApplets() | |||
107 | applets[napplets++] = applet; | 108 | applets[napplets++] = applet; |
108 | applet->library = lib; | 109 | applet->library = lib; |
109 | applet->iface = iface; | 110 | applet->iface = iface; |
111 | |||
112 | QTranslator *trans = new QTranslator(qApp); | ||
113 | QString type = (*it).left( (*it).find(".") ); | ||
114 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | ||
115 | if ( trans->load( tfn )) | ||
116 | qApp->installTranslator( trans ); | ||
117 | else | ||
118 | delete trans; | ||
110 | } else { | 119 | } else { |
111 | exclude += *it; | 120 | exclude += *it; |
112 | delete lib; | 121 | delete lib; |
@@ -118,14 +127,6 @@ void SysTray::addApplets() | |||
118 | TaskbarApplet *applet = applets[napplets]; | 127 | TaskbarApplet *applet = applets[napplets]; |
119 | applet->applet = applet->iface->applet( this ); | 128 | applet->applet = applet->iface->applet( this ); |
120 | appletList.append(*applet); | 129 | appletList.append(*applet); |
121 | QString lang = getenv( "LANG" ); | ||
122 | QTranslator * trans = new QTranslator(qApp); | ||
123 | QString type = (*it).left( (*it).find(".") ); | ||
124 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | ||
125 | if ( trans->load( tfn )) | ||
126 | qApp->installTranslator( trans ); | ||
127 | else | ||
128 | delete trans; | ||
129 | } | 130 | } |
130 | delete applets; | 131 | delete applets; |
131 | #else | 132 | #else |