-rw-r--r-- | core/launcher/launcher.cpp | 2 | ||||
-rw-r--r-- | core/launcher/mrulist.cpp | 42 |
2 files changed, 38 insertions, 6 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index cf1a3c8..17a30e6 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp @@ -594,3 +594,3 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: } - } + } } diff --git a/core/launcher/mrulist.cpp b/core/launcher/mrulist.cpp index 4daf7d2..6066dac 100644 --- a/core/launcher/mrulist.cpp +++ b/core/launcher/mrulist.cpp @@ -1,2 +1,3 @@ /********************************************************************** +** Copyright (C) 2002 Holger 'zecke' Freyther ** Copyright (C) 2000 Trolltech AS. All rights reserved. @@ -73,3 +74,31 @@ void MRUList::addTask( const AppLnk *appLnk ) return; - + // ok we wan't to delete old icons from the taskbar + // get the window list and see which windows aren't there any more + QList<AppLnk> cleanUp; + cleanUp.setAutoDelete( TRUE ); + const QList<QWSWindow> &list = qwsServer->clientWindows(); + QWSWindow* w; + bool running = false; // to see what we should do + for ( ; i < task->count(); i++ ) { + AppLnk *t = task->at(i); + running = false; + for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { + QString app = w->client()->identity(); + if( app == t->exec( ) ){ + running = true; + break; + } + } + if(!running ) { // gues what we do now + cleanUp.append( t); + } + } + // no do a clean up of these old icons + AppLnk *lnk; + for( lnk = cleanUp.first(); lnk != 0; lnk = cleanUp.next() ){ + task->remove( lnk ); + } + cleanUp.clear(); // should be deleted too + + i = 0; for ( ; i < task->count(); i++ ) { @@ -86,3 +115,3 @@ void MRUList::addTask( const AppLnk *appLnk ) } - + // check which tasks are running and delete them from the list AppLnk *t = new AppLnk( *appLnk ); @@ -115,3 +144,3 @@ bool MRUList::quitOldApps() for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { - QString app = w->client()->identity(); + QString app = w->client()->identity(); if ( appsstarted.contains(app) && !appsrunning.contains(app) ) @@ -126,4 +155,7 @@ bool MRUList::quitOldApps() AppLnk *t = task->at(i); - if ( t->exec() == *it ) - Global::terminate(t); + if ( t->exec() == *it ){ + task->remove(i ); + delete t; + Global::terminate(t); + } } |