summaryrefslogtreecommitdiff
path: root/core/launcher/systray.cpp
Unidiff
Diffstat (limited to 'core/launcher/systray.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/systray.cpp17
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
@@ -90,8 +90,9 @@ void SysTray::addApplets()
90 cfg.writeEntry("SafeMode",TRUE); 90 cfg.writeEntry("SafeMode",TRUE);
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();
97 QStringList::Iterator it; 98 QStringList::Iterator it;
@@ -106,8 +107,16 @@ void SysTray::addApplets()
106 TaskbarApplet *applet = new TaskbarApplet; 107 TaskbarApplet *applet = new TaskbarApplet;
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;
113 } 122 }
@@ -117,16 +126,8 @@ void SysTray::addApplets()
117 while (napplets--) { 126 while (napplets--) {
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
132 TaskbarApplet applet; 133 TaskbarApplet applet;