summaryrefslogtreecommitdiff
path: root/core/launcher/systray.cpp
Unidiff
Diffstat (limited to 'core/launcher/systray.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/systray.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp
index 64356ca..6122770 100644
--- a/core/launcher/systray.cpp
+++ b/core/launcher/systray.cpp
@@ -60,24 +60,32 @@ static int compareAppletPositions(const void *a, const void *b)
60 60
61void SysTray::loadApplets() 61void SysTray::loadApplets()
62{ 62{
63 hide(); 63 hide();
64 clearApplets(); 64 clearApplets();
65 addApplets(); 65 addApplets();
66} 66}
67 67
68void SysTray::clearApplets() 68void SysTray::clearApplets()
69{ 69{
70#ifndef QT_NO_COMPONENTS 70#ifndef QT_NO_COMPONENTS
71 71
72 /*
73 * Note on clearing. SOme applets delete their
74 * applets themselves some don't do it
75 * and on restart this can crash. If we delete it
76 * here we might end up in a double deletion. We could
77 * use QGuardedPtr but that would be one QOBject
78 * for every applet more but only useful for restart
79 */
72 QValueList<TaskbarApplet>::Iterator mit; 80 QValueList<TaskbarApplet>::Iterator mit;
73 for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { 81 for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) {
74 (*mit).iface->release(); 82 (*mit).iface->release();
75 (*mit).library->unload(); 83 (*mit).library->unload();
76 delete (*mit).library; 84 delete (*mit).library;
77 } 85 }
78 86
79#endif 87#endif
80 appletList.clear(); 88 appletList.clear();
81 if ( layout ) 89 if ( layout )
82 delete layout; 90 delete layout;
83 layout = new QHBoxLayout( this, 0, 1 ); 91 layout = new QHBoxLayout( this, 0, 1 );