-rw-r--r-- | core/launcher/systray.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index 6122770..691f6b8 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp | |||
@@ -81,56 +81,61 @@ void SysTray::clearApplets() | |||
81 | for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { | 81 | for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { |
82 | (*mit).iface->release(); | 82 | (*mit).iface->release(); |
83 | (*mit).library->unload(); | 83 | (*mit).library->unload(); |
84 | delete (*mit).library; | 84 | delete (*mit).library; |
85 | } | 85 | } |
86 | 86 | ||
87 | #endif | 87 | #endif |
88 | appletList.clear(); | 88 | appletList.clear(); |
89 | if ( layout ) | 89 | if ( layout ) |
90 | delete layout; | 90 | delete layout; |
91 | layout = new QHBoxLayout( this, 0, 1 ); | 91 | layout = new QHBoxLayout( this, 0, 1 ); |
92 | layout->setAutoAdd(TRUE); | 92 | layout->setAutoAdd(TRUE); |
93 | } | 93 | } |
94 | 94 | ||
95 | void SysTray::addApplets() | 95 | void SysTray::addApplets() |
96 | { | 96 | { |
97 | hide(); | 97 | hide(); |
98 | #ifndef QT_NO_COMPONENTS | 98 | #ifndef QT_NO_COMPONENTS |
99 | Config cfg( "Taskbar" ); | 99 | Config cfg( "Taskbar" ); |
100 | cfg.setGroup( "Applets" ); | 100 | cfg.setGroup( "Applets" ); |
101 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); | 101 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); |
102 | 102 | ||
103 | QString lang = getenv( "LANG" ); | 103 | QString lang = getenv( "LANG" ); |
104 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; | 104 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; |
105 | #ifdef Q_OS_MACX | ||
106 | QDir dir( path, "lib*.dylib" ); | ||
107 | #else | ||
105 | QDir dir( path, "lib*.so" ); | 108 | QDir dir( path, "lib*.so" ); |
109 | #endif /* Q_OS_MACX */ | ||
106 | QStringList list = dir.entryList(); | 110 | QStringList list = dir.entryList(); |
107 | QStringList::Iterator it; | 111 | QStringList::Iterator it; |
108 | int napplets=0; | 112 | int napplets=0; |
109 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; | 113 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; |
110 | for ( it = list.begin(); it != list.end(); ++it ) { | 114 | for ( it = list.begin(); it != list.end(); ++it ) { |
111 | if ( exclude.find( *it ) != exclude.end() ) | 115 | if ( exclude.find( *it ) != exclude.end() ) |
112 | continue; | 116 | continue; |
117 | qWarning( "Found Applet: %s", (*it).latin1() ); | ||
113 | TaskbarAppletInterface *iface = 0; | 118 | TaskbarAppletInterface *iface = 0; |
114 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 119 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
115 | if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { | 120 | if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { |
116 | TaskbarApplet *applet = new TaskbarApplet; | 121 | TaskbarApplet *applet = new TaskbarApplet; |
117 | applets[napplets++] = applet; | 122 | applets[napplets++] = applet; |
118 | applet->library = lib; | 123 | applet->library = lib; |
119 | applet->iface = iface; | 124 | applet->iface = iface; |
120 | 125 | ||
121 | QTranslator *trans = new QTranslator(qApp); | 126 | QTranslator *trans = new QTranslator(qApp); |
122 | QString type = (*it).left( (*it).find(".") ); | 127 | QString type = (*it).left( (*it).find(".") ); |
123 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 128 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
124 | if ( trans->load( tfn )) | 129 | if ( trans->load( tfn )) |
125 | qApp->installTranslator( trans ); | 130 | qApp->installTranslator( trans ); |
126 | else | 131 | else |
127 | delete trans; | 132 | delete trans; |
128 | } else { | 133 | } else { |
129 | exclude += *it; | 134 | exclude += *it; |
130 | delete lib; | 135 | delete lib; |
131 | } | 136 | } |
132 | } | 137 | } |
133 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); | 138 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); |
134 | qsort(applets,napplets,sizeof(applets[0]),compareAppletPositions); | 139 | qsort(applets,napplets,sizeof(applets[0]),compareAppletPositions); |
135 | while (napplets--) { | 140 | while (napplets--) { |
136 | TaskbarApplet *applet = applets[napplets]; | 141 | TaskbarApplet *applet = applets[napplets]; |