-rw-r--r-- | core/launcher/systray.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index 6cc1446..3c72d25 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp | |||
@@ -9,42 +9,40 @@ | |||
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "systray.h" | ||
22 | |||
23 | /* OPIE */ | ||
24 | #include <opie2/odebug.h> | ||
21 | #include <qtopia/qpeapplication.h> | 25 | #include <qtopia/qpeapplication.h> |
22 | #include <qtopia/qlibrary.h> | 26 | #include <qtopia/qlibrary.h> |
23 | #include <qtopia/config.h> | 27 | #include <qtopia/config.h> |
28 | using namespace Opie::Core; | ||
24 | 29 | ||
30 | /* QT */ | ||
25 | #include <qlayout.h> | 31 | #include <qlayout.h> |
26 | #include <qdir.h> | 32 | #include <qdir.h> |
27 | 33 | ||
28 | #include "systray.h" | 34 | /* STD */ |
29 | |||
30 | #include <stdlib.h> | 35 | #include <stdlib.h> |
31 | 36 | ||
32 | /* ### Single build floppies ### */ | ||
33 | #if 0 | ||
34 | #ifdef QT_NO_COMPONENTS | ||
35 | #include "../plugins/applets/clockapplet/clockappletimpl.h" | ||
36 | #endif | ||
37 | #endif | ||
38 | |||
39 | SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0) | 37 | SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0) |
40 | { | 38 | { |
41 | //setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 39 | //setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
42 | loadApplets(); | 40 | loadApplets(); |
43 | } | 41 | } |
44 | 42 | ||
45 | SysTray::~SysTray() | 43 | SysTray::~SysTray() |
46 | { | 44 | { |
47 | clearApplets(); | 45 | clearApplets(); |
48 | } | 46 | } |
49 | 47 | ||
50 | static int compareAppletPositions(const void *a, const void *b) | 48 | static int compareAppletPositions(const void *a, const void *b) |
@@ -103,25 +101,25 @@ void SysTray::addApplets() | |||
103 | #ifdef Q_OS_MACX | 101 | #ifdef Q_OS_MACX |
104 | QDir dir( path, "lib*.dylib" ); | 102 | QDir dir( path, "lib*.dylib" ); |
105 | #else | 103 | #else |
106 | QDir dir( path, "lib*.so" ); | 104 | QDir dir( path, "lib*.so" ); |
107 | #endif /* Q_OS_MACX */ | 105 | #endif /* Q_OS_MACX */ |
108 | QStringList list = dir.entryList(); | 106 | QStringList list = dir.entryList(); |
109 | QStringList::Iterator it; | 107 | QStringList::Iterator it; |
110 | int napplets=0; | 108 | int napplets=0; |
111 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; | 109 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; |
112 | for ( it = list.begin(); it != list.end(); ++it ) { | 110 | for ( it = list.begin(); it != list.end(); ++it ) { |
113 | if ( exclude.find( *it ) != exclude.end() ) | 111 | if ( exclude.find( *it ) != exclude.end() ) |
114 | continue; | 112 | continue; |
115 | qWarning( "Found Applet: %s", (*it).latin1() ); | 113 | owarn << "Found Applet: " << (*it) << "" << oendl; |
116 | TaskbarAppletInterface *iface = 0; | 114 | TaskbarAppletInterface *iface = 0; |
117 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 115 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
118 | if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { | 116 | if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { |
119 | TaskbarApplet *applet = new TaskbarApplet; | 117 | TaskbarApplet *applet = new TaskbarApplet; |
120 | applets[napplets++] = applet; | 118 | applets[napplets++] = applet; |
121 | applet->library = lib; | 119 | applet->library = lib; |
122 | applet->iface = iface; | 120 | applet->iface = iface; |
123 | 121 | ||
124 | QTranslator *trans = new QTranslator(qApp); | 122 | QTranslator *trans = new QTranslator(qApp); |
125 | QString type = (*it).left( (*it).find(".") ); | 123 | QString type = (*it).left( (*it).find(".") ); |
126 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 124 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
127 | if ( trans->load( tfn )) | 125 | if ( trans->load( tfn )) |