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, 2 insertions, 2 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp
index f3a7651..66f665f 100644
--- a/core/launcher/startmenu.cpp
+++ b/core/launcher/startmenu.cpp
@@ -294,68 +294,68 @@ void StartMenu::clearApplets()
294 294
295 applet->iface->release(); 295 applet->iface->release();
296 applet->library->unload(); 296 applet->library->unload();
297 delete applet-> library; 297 delete applet-> library;
298 } 298 }
299 menuApplets.clear(); 299 menuApplets.clear();
300} 300}
301 301
302 302
303 303
304 304
305void StartMenu::loadApplets() 305void StartMenu::loadApplets()
306{ 306{
307 Config cfg( "StartMenu" ); 307 Config cfg( "StartMenu" );
308 cfg.setGroup( "Applets" ); 308 cfg.setGroup( "Applets" );
309 309
310 // SafeMode causes too much problems, so we disable it for now -- 310 // SafeMode causes too much problems, so we disable it for now --
311 // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 311 // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02
312 // removed in the remerge PluginManager could handle it 312 // removed in the remerge PluginManager could handle it
313 // we don't currently use it -zecke 313 // we don't currently use it -zecke
314 314
315 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); 315 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' );
316 316
317 QString lang = getenv( "LANG" ); 317 QString lang = getenv( "LANG" );
318 QString path = QPEApplication::qpeDir() + "/plugins/applets"; 318 QString path = QPEApplication::qpeDir() + "plugins/applets";
319 QDir dir( path, "lib*.so" ); 319 QDir dir( path, "lib*.so" );
320 QStringList list = dir.entryList(); 320 QStringList list = dir.entryList();
321 QStringList::Iterator it; 321 QStringList::Iterator it;
322 int napplets = 0; 322 int napplets = 0;
323 MenuApplet* *xapplets = new MenuApplet*[list.count()]; 323 MenuApplet* *xapplets = new MenuApplet*[list.count()];
324 for ( it = list.begin(); it != list.end(); ++it ) { 324 for ( it = list.begin(); it != list.end(); ++it ) {
325 if ( exclude.find( *it ) != exclude.end() ) 325 if ( exclude.find( *it ) != exclude.end() )
326 continue; 326 continue;
327 MenuAppletInterface *iface = 0; 327 MenuAppletInterface *iface = 0;
328 QLibrary *lib = new QLibrary( path + "/" + *it ); 328 QLibrary *lib = new QLibrary( path + "/" + *it );
329 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { 329 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) {
330 MenuApplet *applet = new MenuApplet; 330 MenuApplet *applet = new MenuApplet;
331 xapplets[napplets++] = applet; 331 xapplets[napplets++] = applet;
332 applet->library = lib; 332 applet->library = lib;
333 applet->iface = iface; 333 applet->iface = iface;
334 334
335 QTranslator *trans = new QTranslator(qApp); 335 QTranslator *trans = new QTranslator(qApp);
336 QString type = (*it).left( (*it).find(".") ); 336 QString type = (*it).left( (*it).find(".") );
337 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 337 QString tfn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+type+".qm";
338 if ( trans->load( tfn )) 338 if ( trans->load( tfn ))
339 qApp->installTranslator( trans ); 339 qApp->installTranslator( trans );
340 else 340 else
341 delete trans; 341 delete trans;
342 } else { 342 } else {
343 exclude += *it; 343 exclude += *it;
344 delete lib; 344 delete lib;
345 } 345 }
346 } 346 }
347 cfg.writeEntry( "ExcludeApplets", exclude, ',' ); 347 cfg.writeEntry( "ExcludeApplets", exclude, ',' );
348 qsort(xapplets, napplets, sizeof(menuApplets[0]), compareAppletPositions); 348 qsort(xapplets, napplets, sizeof(menuApplets[0]), compareAppletPositions);
349 349
350 350
351 while ( napplets-- ) { 351 while ( napplets-- ) {
352 MenuApplet *applet = xapplets[napplets]; 352 MenuApplet *applet = xapplets[napplets];
353 applet->popup = applet->iface->popup( this ); 353 applet->popup = applet->iface->popup( this );
354 354
355 // menuApplets got an id < -1 355 // menuApplets got an id < -1
356 menuApplets.insert( -( currentItem + 2 ), new MenuApplet( *applet ) ); 356 menuApplets.insert( -( currentItem + 2 ), new MenuApplet( *applet ) );
357 currentItem++; 357 currentItem++;
358 } 358 }
359 delete [] xapplets; 359 delete [] xapplets;
360 360
361 addApplets( launchMenu ); 361 addApplets( launchMenu );