-rw-r--r-- | core/launcher/launcher.cpp | 0 | ||||
-rw-r--r-- | core/launcher/mrulist.cpp | 36 |
2 files changed, 34 insertions, 2 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 | |||
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 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Holger 'zecke' Freyther | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 3 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
@@ -73,3 +74,31 @@ void MRUList::addTask( const AppLnk *appLnk ) | |||
73 | return; | 74 | return; |
75 | // ok we wan't to delete old icons from the taskbar | ||
76 | // get the window list and see which windows aren't there any more | ||
77 | QList<AppLnk> cleanUp; | ||
78 | cleanUp.setAutoDelete( TRUE ); | ||
79 | const QList<QWSWindow> &list = qwsServer->clientWindows(); | ||
80 | QWSWindow* w; | ||
81 | bool running = false; // to see what we should do | ||
82 | for ( ; i < task->count(); i++ ) { | ||
83 | AppLnk *t = task->at(i); | ||
84 | running = false; | ||
85 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { | ||
86 | QString app = w->client()->identity(); | ||
87 | if( app == t->exec( ) ){ | ||
88 | running = true; | ||
89 | break; | ||
90 | } | ||
91 | } | ||
92 | if(!running ) { // gues what we do now | ||
93 | cleanUp.append( t); | ||
94 | } | ||
95 | } | ||
96 | // no do a clean up of these old icons | ||
97 | AppLnk *lnk; | ||
98 | for( lnk = cleanUp.first(); lnk != 0; lnk = cleanUp.next() ){ | ||
99 | task->remove( lnk ); | ||
100 | } | ||
101 | cleanUp.clear(); // should be deleted too | ||
74 | 102 | ||
103 | i = 0; | ||
75 | for ( ; i < task->count(); i++ ) { | 104 | for ( ; i < task->count(); i++ ) { |
@@ -86,3 +115,3 @@ void MRUList::addTask( const AppLnk *appLnk ) | |||
86 | } | 115 | } |
87 | 116 | // check which tasks are running and delete them from the list | |
88 | AppLnk *t = new AppLnk( *appLnk ); | 117 | AppLnk *t = new AppLnk( *appLnk ); |
@@ -126,3 +155,5 @@ bool MRUList::quitOldApps() | |||
126 | AppLnk *t = task->at(i); | 155 | AppLnk *t = task->at(i); |
127 | if ( t->exec() == *it ) | 156 | if ( t->exec() == *it ){ |
157 | task->remove(i ); | ||
158 | delete t; | ||
128 | Global::terminate(t); | 159 | Global::terminate(t); |
@@ -130,2 +161,3 @@ bool MRUList::quitOldApps() | |||
130 | } | 161 | } |
162 | } | ||
131 | return TRUE; | 163 | return TRUE; |