summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/startmenu.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp
index 24a9d7e..d03af89 100644
--- a/core/launcher/startmenu.cpp
+++ b/core/launcher/startmenu.cpp
@@ -210,129 +210,129 @@ void StartMenu::createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool l
210} 210}
211 211
212void StartMenu::createMenuEntries( QPopupMenu *menu, QDir dir, bool ltabs, bool lot ) 212void StartMenu::createMenuEntries( QPopupMenu *menu, QDir dir, bool ltabs, bool lot )
213{ 213{
214 if ( lot ) { 214 if ( lot ) {
215 dir.setFilter( QDir::Files ); 215 dir.setFilter( QDir::Files );
216 dir.setNameFilter( "*.desktop" ); 216 dir.setNameFilter( "*.desktop" );
217 QStringList files = dir.entryList(); 217 QStringList files = dir.entryList();
218 files.sort(); 218 files.sort();
219 219
220 for ( QStringList::Iterator it = files.begin(); it != files.end(); it++ ) { 220 for ( QStringList::Iterator it = files.begin(); it != files.end(); it++ ) {
221 createAppEntry( menu, dir, *it ); 221 createAppEntry( menu, dir, *it );
222 } 222 }
223 } 223 }
224 if ( ltabs ) { 224 if ( ltabs ) {
225 dir.setNameFilter( "*" ); 225 dir.setNameFilter( "*" );
226 dir.setFilter( QDir::Dirs ); 226 dir.setFilter( QDir::Dirs );
227 QStringList dirs = dir.entryList(); 227 QStringList dirs = dir.entryList();
228 dirs.sort(); 228 dirs.sort();
229 229
230 for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); it++ ) { 230 for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); it++ ) {
231 createDirEntry( menu, dir, *it, lot ); 231 createDirEntry( menu, dir, *it, lot );
232 } 232 }
233 } 233 }
234} 234}
235 235
236bool StartMenu::loadMenu( QPopupMenu *menu ) 236bool StartMenu::loadMenu( QPopupMenu *menu )
237{ 237{
238 Config cfg("StartMenu"); 238 Config cfg("StartMenu");
239 cfg.setGroup("Menu"); 239 cfg.setGroup("Menu");
240 240
241 bool ltabs = cfg.readBoolEntry("LauncherTabs", TRUE); 241 bool ltabs = cfg.readBoolEntry("LauncherTabs", TRUE);
242 bool lot = cfg.readBoolEntry("LauncherOther", TRUE); 242 bool lot = cfg.readBoolEntry("LauncherOther", TRUE);
243 useWidePopupMenu = cfg.readBoolEntry( "LauncherSubPopup", TRUE ); 243 useWidePopupMenu = cfg.readBoolEntry( "LauncherSubPopup", TRUE );
244 bool sepfirst = !ltabs && !lot; 244 bool sepfirst = !ltabs && !lot;
245 245
246 currentItem = 0; 246 currentItem = 0;
247 launchMenu->clear(); 247 launchMenu->clear();
248 248
249 appLnks.setAutoDelete( true ); 249 appLnks.setAutoDelete( true );
250 tabNames.setAutoDelete( true ); 250 tabNames.setAutoDelete( true );
251 appLnks.clear(); 251 appLnks.clear();
252 tabNames.clear(); 252 tabNames.clear();
253 appLnks.setAutoDelete( false ); 253 appLnks.setAutoDelete( false );
254 tabNames.setAutoDelete( false ); 254 tabNames.setAutoDelete( false );
255 255
256 QDir dir( MimeType::appsFolderName(), QString::null, QDir::Name ); 256 QDir dir( MimeType::appsFolderName(), QString::null, QDir::Name );
257 createMenuEntries( menu, dir, ltabs, lot ); 257 createMenuEntries( menu, dir, ltabs, lot );
258 258
259 if ( !menu->count() ) sepfirst = TRUE; 259 if ( !menu->count() ) sepfirst = TRUE;
260 260
261 launchMenu->setName( sepfirst ? "accessories" : "accessories_need_sep" ); // No tr 261 launchMenu->setName( sepfirst ? "accessories" : "accessories_need_sep" ); // No tr
262 262
263 return currentItem; 263 return currentItem;
264} 264}
265 265
266 266
267void StartMenu::launch() 267void StartMenu::launch()
268{ 268{
269 int y = mapToGlobal( QPoint() ).y() - launchMenu->sizeHint().height(); 269 int y = mapToGlobal( QPoint() ).y() - launchMenu->sizeHint().height();
270 270
271 if ( launchMenu->isVisible() ) 271 if ( launchMenu->isVisible() )
272 launchMenu->hide(); 272 launchMenu->hide();
273 else 273 else
274 launchMenu->popup( QPoint( 1, y ) ); 274 launchMenu->popup( QPoint( 0, y ) );
275} 275}
276 276
277 277
278 278
279 279
280static int compareAppletPositions(const void *b, const void *a) 280static int compareAppletPositions(const void *b, const void *a)
281{ 281{
282 const MenuApplet* aa = *(const MenuApplet**)a; 282 const MenuApplet* aa = *(const MenuApplet**)a;
283 const MenuApplet* ab = *(const MenuApplet**)b; 283 const MenuApplet* ab = *(const MenuApplet**)b;
284 int d = aa->iface->position() - ab->iface->position(); 284 int d = aa->iface->position() - ab->iface->position();
285 if ( d ) return d; 285 if ( d ) return d;
286 return QString::compare(aa->library->library(),ab->library->library()); 286 return QString::compare(aa->library->library(),ab->library->library());
287} 287}
288 288
289void StartMenu::clearApplets() 289void StartMenu::clearApplets()
290{ 290{
291 if ( launchMenu ) 291 if ( launchMenu )
292 launchMenu-> hide(); 292 launchMenu-> hide();
293 293
294 for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) { 294 for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) {
295 MenuApplet *applet = it.current(); 295 MenuApplet *applet = it.current();
296 if ( launchMenu ) { 296 if ( launchMenu ) {
297 launchMenu->removeItem( applet-> id ); 297 launchMenu->removeItem( applet-> id );
298 delete applet->popup; 298 delete applet->popup;
299 } 299 }
300 300
301 applet->iface->release(); 301 applet->iface->release();
302 applet->library->unload(); 302 applet->library->unload();
303 delete applet-> library; 303 delete applet-> library;
304 } 304 }
305 menuApplets.clear(); 305 menuApplets.clear();
306} 306}
307 307
308 308
309 309
310 310
311void StartMenu::loadApplets() 311void StartMenu::loadApplets()
312{ 312{
313 Config cfg( "StartMenu" ); 313 Config cfg( "StartMenu" );
314 cfg.setGroup( "Applets" ); 314 cfg.setGroup( "Applets" );
315 315
316 // SafeMode causes too much problems, so we disable it for now -- 316 // SafeMode causes too much problems, so we disable it for now --
317 // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 317 // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02
318 // removed in the remerge PluginManager could handle it 318 // removed in the remerge PluginManager could handle it
319 // we don't currently use it -zecke 319 // we don't currently use it -zecke
320 320
321 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); 321 QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' );
322 322
323 QString lang = getenv( "LANG" ); 323 QString lang = getenv( "LANG" );
324 QString path = QPEApplication::qpeDir() + "plugins/applets"; 324 QString path = QPEApplication::qpeDir() + "plugins/applets";
325 QDir dir( path, "lib*.so" ); 325 QDir dir( path, "lib*.so" );
326 QStringList list = dir.entryList(); 326 QStringList list = dir.entryList();
327 QStringList::Iterator it; 327 QStringList::Iterator it;
328 int napplets = 0; 328 int napplets = 0;
329 MenuApplet* *xapplets = new MenuApplet*[list.count()]; 329 MenuApplet* *xapplets = new MenuApplet*[list.count()];
330 for ( it = list.begin(); it != list.end(); ++it ) { 330 for ( it = list.begin(); it != list.end(); ++it ) {
331 if ( exclude.find( *it ) != exclude.end() ) 331 if ( exclude.find( *it ) != exclude.end() )
332 continue; 332 continue;
333 MenuAppletInterface *iface = 0; 333 MenuAppletInterface *iface = 0;
334 QLibrary *lib = new QLibrary( path + "/" + *it ); 334 QLibrary *lib = new QLibrary( path + "/" + *it );
335 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { 335 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) {
336 MenuApplet *applet = new MenuApplet; 336 MenuApplet *applet = new MenuApplet;
337 xapplets[napplets++] = applet; 337 xapplets[napplets++] = applet;
338 applet->library = lib; 338 applet->library = lib;