summaryrefslogtreecommitdiff
path: root/core/launcher/startmenu.cpp
Unidiff
Diffstat (limited to 'core/launcher/startmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/startmenu.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp
index 014418d..08ae885 100644
--- a/core/launcher/startmenu.cpp
+++ b/core/launcher/startmenu.cpp
@@ -235,49 +235,53 @@ void StartMenu::clearApplets()
235 applet-> iface-> release(); 235 applet-> iface-> release();
236 applet-> library-> unload(); 236 applet-> library-> unload();
237 delete applet-> library; 237 delete applet-> library;
238 } 238 }
239 m_applets.clear(); 239 m_applets.clear();
240} 240}
241 241
242 242
243 243
244 244
245void StartMenu::loadApplets() 245void StartMenu::loadApplets()
246{ 246{
247 Config cfg( "StartMenu" ); 247 Config cfg( "StartMenu" );
248 cfg.setGroup( "Applets" ); 248 cfg.setGroup( "Applets" );
249 249
250 // SafeMode causes too much problems, so we disable it for now -- 250 // SafeMode causes too much problems, so we disable it for now --
251 // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 251 // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02
252 // removed in the remerge PluginManager could handle it 252 // removed in the remerge PluginManager could handle it
253 // we don't currently use it -zecke 253 // we don't currently use it -zecke
254 254
255 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); 255 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' );
256 256
257 QString lang = getenv( "LANG" ); 257 QString lang = getenv( "LANG" );
258 QString path = QPEApplication::qpeDir() + "/plugins/applets"; 258 QString path = QPEApplication::qpeDir() + "/plugins/applets";
259#ifdef Q_OS_MACX
260 QDir dir( path, "lib*.dylib" );
261#else
259 QDir dir( path, "lib*.so" ); 262 QDir dir( path, "lib*.so" );
263#endif /* Q_OS_MACX */
260 QStringList list = dir.entryList(); 264 QStringList list = dir.entryList();
261 QStringList::Iterator it; 265 QStringList::Iterator it;
262 int napplets=0; 266 int napplets=0;
263 MenuApplet* *xapplets = new MenuApplet*[list.count()]; 267 MenuApplet* *xapplets = new MenuApplet*[list.count()];
264 for ( it = list.begin(); it != list.end(); ++it ) { 268 for ( it = list.begin(); it != list.end(); ++it ) {
265 if ( exclude.find( *it ) != exclude.end() ) 269 if ( exclude.find( *it ) != exclude.end() )
266 continue; 270 continue;
267 MenuAppletInterface *iface = 0; 271 MenuAppletInterface *iface = 0;
268 QLibrary *lib = new QLibrary( path + "/" + *it ); 272 QLibrary *lib = new QLibrary( path + "/" + *it );
269 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { 273 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) {
270 MenuApplet *applet = new MenuApplet; 274 MenuApplet *applet = new MenuApplet;
271 xapplets[napplets++] = applet; 275 xapplets[napplets++] = applet;
272 applet->library = lib; 276 applet->library = lib;
273 applet->iface = iface; 277 applet->iface = iface;
274 278
275 QTranslator *trans = new QTranslator(qApp); 279 QTranslator *trans = new QTranslator(qApp);
276 QString type = (*it).left( (*it).find(".") ); 280 QString type = (*it).left( (*it).find(".") );
277 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 281 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm";
278 if ( trans->load( tfn )) 282 if ( trans->load( tfn ))
279 qApp->installTranslator( trans ); 283 qApp->installTranslator( trans );
280 else 284 else
281 delete trans; 285 delete trans;
282 } else { 286 } else {
283 exclude += *it; 287 exclude += *it;