-rw-r--r-- | core/launcher/systray.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index 4767150..697971d 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp | |||
@@ -59,49 +59,53 @@ void SysTray::loadApplets() | |||
59 | 59 | ||
60 | void SysTray::clearApplets() | 60 | void SysTray::clearApplets() |
61 | { | 61 | { |
62 | hide(); | 62 | hide(); |
63 | #ifndef SINGLE_APP | 63 | #ifndef SINGLE_APP |
64 | QValueList<TaskbarApplet>::Iterator mit; | 64 | QValueList<TaskbarApplet>::Iterator mit; |
65 | for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { | 65 | for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { |
66 | (*mit).iface->release(); | 66 | (*mit).iface->release(); |
67 | (*mit).library->unload(); | 67 | (*mit).library->unload(); |
68 | delete (*mit).library; | 68 | delete (*mit).library; |
69 | } | 69 | } |
70 | #endif | 70 | #endif |
71 | appletList.clear(); | 71 | appletList.clear(); |
72 | if ( layout ) | 72 | if ( layout ) |
73 | delete layout; | 73 | delete layout; |
74 | layout = new QHBoxLayout( this, 0, 1 ); | 74 | layout = new QHBoxLayout( this, 0, 1 ); |
75 | layout->setAutoAdd(TRUE); | 75 | layout->setAutoAdd(TRUE); |
76 | } | 76 | } |
77 | 77 | ||
78 | void SysTray::addApplets() | 78 | void SysTray::addApplets() |
79 | { | 79 | { |
80 | #ifndef SINGLE_APP | 80 | #ifndef SINGLE_APP |
81 | Config cfg( "Taskbar" ); | 81 | Config cfg( "Taskbar" ); |
82 | cfg.setGroup( "Applets" ); | 82 | cfg.setGroup( "Applets" ); |
83 | bool safe = cfg.readBoolEntry("SafeMode",FALSE); | 83 | |
84 | // SafeMode causes too much problems, so we disable it for now -- | ||
85 | // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 | ||
86 | |||
87 | bool safe = false; //cfg.readBoolEntry("SafeMode",FALSE); | ||
84 | if ( safe && !safety_tid ) | 88 | if ( safe && !safety_tid ) |
85 | return; | 89 | return; |
86 | cfg.writeEntry("SafeMode",TRUE); | 90 | cfg.writeEntry("SafeMode",TRUE); |
87 | cfg.write(); | 91 | cfg.write(); |
88 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); | 92 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); |
89 | 93 | ||
90 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; | 94 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; |
91 | QDir dir( path, "lib*.so" ); | 95 | QDir dir( path, "lib*.so" ); |
92 | QStringList list = dir.entryList(); | 96 | QStringList list = dir.entryList(); |
93 | QStringList::Iterator it; | 97 | QStringList::Iterator it; |
94 | int napplets=0; | 98 | int napplets=0; |
95 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; | 99 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; |
96 | for ( it = list.begin(); it != list.end(); ++it ) { | 100 | for ( it = list.begin(); it != list.end(); ++it ) { |
97 | if ( exclude.find( *it ) != exclude.end() ) | 101 | if ( exclude.find( *it ) != exclude.end() ) |
98 | continue; | 102 | continue; |
99 | TaskbarAppletInterface *iface = 0; | 103 | TaskbarAppletInterface *iface = 0; |
100 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 104 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
101 | if ( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) { | 105 | if ( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) { |
102 | TaskbarApplet *applet = new TaskbarApplet; | 106 | TaskbarApplet *applet = new TaskbarApplet; |
103 | applets[napplets++] = applet; | 107 | applets[napplets++] = applet; |
104 | applet->library = lib; | 108 | applet->library = lib; |
105 | applet->iface = iface; | 109 | applet->iface = iface; |
106 | } else { | 110 | } else { |
107 | exclude += *it; | 111 | exclude += *it; |