summaryrefslogtreecommitdiff
path: root/core/settings/launcher/taskbarsettings.cpp
Unidiff
Diffstat (limited to 'core/settings/launcher/taskbarsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/taskbarsettings.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp
index b3e302a..d03ea49 100644
--- a/core/settings/launcher/taskbarsettings.cpp
+++ b/core/settings/launcher/taskbarsettings.cpp
@@ -72,51 +72,68 @@ void TaskbarSettings::init ( )
72{ 72{
73 Config cfg ( "Taskbar" ); 73 Config cfg ( "Taskbar" );
74 cfg. setGroup ( "Applets" ); 74 cfg. setGroup ( "Applets" );
75 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); 75 QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
76 76
77 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; 77 QString path = QPEApplication::qpeDir ( ) + "/plugins/applets";
78#ifdef Q_OS_MACX
79 QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
80#else
78 QStringList list = QDir ( path, "lib*.so" ). entryList ( ); 81 QStringList list = QDir ( path, "lib*.so" ). entryList ( );
82#endif /* Q_OS_MACX */
79 83
80 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { 84 for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
81 QString name; 85 QString name;
82 QPixmap icon; 86 QPixmap icon;
83 TaskbarNamedAppletInterface *iface = 0; 87 TaskbarNamedAppletInterface *iface = 0;
84 88
89 qWarning("Load applet: %s", (*it).latin1() );
85 QLibrary *lib = new QLibrary ( path + "/" + *it ); 90 QLibrary *lib = new QLibrary ( path + "/" + *it );
86 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); 91 lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface );
92 qWarning("<1>");
87 if ( iface ) { 93 if ( iface ) {
94 qWarning("<2>");
88 QString lang = getenv( "LANG" ); 95 QString lang = getenv( "LANG" );
89 QTranslator *trans = new QTranslator ( qApp ); 96 QTranslator *trans = new QTranslator ( qApp );
90 QString type = (*it). left ((*it). find (".")); 97 QString type = (*it). left ((*it). find ("."));
91 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; 98 QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm";
92 if ( trans-> load ( tfn )) 99 if ( trans-> load ( tfn ))
93 qApp-> installTranslator ( trans ); 100 qApp-> installTranslator ( trans );
94 else 101 else
95 delete trans; 102 delete trans;
96 name = iface-> name ( ); 103 name = iface-> name ( );
97 icon = iface-> icon ( ); 104 icon = iface-> icon ( );
98 iface-> release ( ); 105 iface-> release ( );
99 } 106 }
107 qWarning("<3>");
100 if ( !iface ) { 108 if ( !iface ) {
109 qWarning("<4>");
101 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); 110 lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface );
102 111
103 if ( iface ) { 112 if ( iface ) {
113 qWarning("<5>");
104 name = (*it). mid ( 3 ); 114 name = (*it). mid ( 3 );
115 qWarning("Found applet: %s", name.latin1() );
116#ifdef Q_OS_MACX
117 int sep = name. find( ".dylib" );
118#else
105 int sep = name. find( ".so" ); 119 int sep = name. find( ".so" );
120#endif /* Q_OS_MACX */
106 if ( sep > 0 ) 121 if ( sep > 0 )
107 name. truncate ( sep ); 122 name. truncate ( sep );
108 sep = name. find ( "applet" ); 123 sep = name. find ( "applet" );
109 if ( sep == (int) name.length ( ) - 6 ) 124 if ( sep == (int) name.length ( ) - 6 )
110 name. truncate ( sep ); 125 name. truncate ( sep );
111 name[0] = name[0]. upper ( ); 126 name[0] = name[0]. upper ( );
112 iface-> release ( ); 127 iface-> release ( );
113 } 128 }
114 } 129 }
130 qWarning("<6>");
115 131
116 if ( iface ) { 132 if ( iface ) {
133 qWarning("<7>");
117 QCheckListItem *item; 134 QCheckListItem *item;
118 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); 135 item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
119 if ( !icon. isNull ( )) 136 if ( !icon. isNull ( ))
120 item-> setPixmap ( 0, icon ); 137 item-> setPixmap ( 0, icon );
121 item-> setOn ( exclude. find ( *it ) == exclude. end ( )); 138 item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
122 m_applets [*it] = item; 139 m_applets [*it] = item;