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 | |
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/startmenu.cpp | 17 | ||||
-rw-r--r-- | core/launcher/systray.cpp | 17 |
2 files changed, 18 insertions, 16 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index 917f4c1..7373ea8 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp | |||
@@ -313,4 +313,5 @@ void StartMenu::loadApplets() | |||
313 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); | 313 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); |
314 | 314 | ||
315 | QString lang = getenv( "LANG" ); | ||
315 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; | 316 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; |
316 | QDir dir( path, "lib*.so" ); | 317 | QDir dir( path, "lib*.so" ); |
@@ -329,4 +330,12 @@ void StartMenu::loadApplets() | |||
329 | applet->library = lib; | 330 | applet->library = lib; |
330 | applet->iface = iface; | 331 | applet->iface = iface; |
332 | |||
333 | QTranslator *trans = new QTranslator(qApp); | ||
334 | QString type = (*it).left( (*it).find(".") ); | ||
335 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | ||
336 | if ( trans->load( tfn )) | ||
337 | qApp->installTranslator( trans ); | ||
338 | else | ||
339 | delete trans; | ||
331 | } else { | 340 | } else { |
332 | exclude += *it; | 341 | exclude += *it; |
@@ -343,12 +352,4 @@ void StartMenu::loadApplets() | |||
343 | while (napplets--) { | 352 | while (napplets--) { |
344 | MenuApplet *applet = xapplets[napplets]; | 353 | MenuApplet *applet = xapplets[napplets]; |
345 | QString lang = getenv( "LANG" ); | ||
346 | QTranslator * trans = new QTranslator(qApp); | ||
347 | QString type = (*it).left( (*it).find(".") ); | ||
348 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | ||
349 | if ( trans->load( tfn )) | ||
350 | qApp->installTranslator( trans ); | ||
351 | else | ||
352 | delete trans; | ||
353 | 354 | ||
354 | applet-> popup = applet-> iface-> popup ( this ); | 355 | applet-> popup = applet-> iface-> popup ( this ); |
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 | |||
@@ -92,4 +92,5 @@ void SysTray::addApplets() | |||
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" ); |
@@ -108,4 +109,12 @@ void SysTray::addApplets() | |||
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; |
@@ -119,12 +128,4 @@ void SysTray::addApplets() | |||
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; |