-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginimpl.cpp | 1 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/core/pim/today/plugins/datebook/datebookpluginimpl.cpp b/core/pim/today/plugins/datebook/datebookpluginimpl.cpp index 4159b49..45736bb 100644 --- a/core/pim/today/plugins/datebook/datebookpluginimpl.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginimpl.cpp | |||
@@ -17,16 +17,17 @@ | |||
17 | #include "datebookplugin.h" | 17 | #include "datebookplugin.h" |
18 | #include "datebookpluginimpl.h" | 18 | #include "datebookpluginimpl.h" |
19 | 19 | ||
20 | DatebookPluginImpl::DatebookPluginImpl() { | 20 | DatebookPluginImpl::DatebookPluginImpl() { |
21 | datebookPlugin = new DatebookPlugin(); | 21 | datebookPlugin = new DatebookPlugin(); |
22 | } | 22 | } |
23 | 23 | ||
24 | DatebookPluginImpl::~DatebookPluginImpl() { | 24 | DatebookPluginImpl::~DatebookPluginImpl() { |
25 | delete datebookPlugin; | ||
25 | } | 26 | } |
26 | 27 | ||
27 | TodayPluginObject* DatebookPluginImpl::guiPart() { | 28 | TodayPluginObject* DatebookPluginImpl::guiPart() { |
28 | return datebookPlugin; | 29 | return datebookPlugin; |
29 | } | 30 | } |
30 | 31 | ||
31 | QRESULT DatebookPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { | 32 | QRESULT DatebookPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { |
32 | *iface = 0; | 33 | *iface = 0; |
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 01ef02d..1b31cfd 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -34,18 +34,19 @@ | |||
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qhbox.h> | 35 | #include <qhbox.h> |
36 | #include <opie/otabwidget.h> | 36 | #include <opie/otabwidget.h> |
37 | #include <qdialog.h> | 37 | #include <qdialog.h> |
38 | #include <qwhatsthis.h> | 38 | #include <qwhatsthis.h> |
39 | 39 | ||
40 | 40 | ||
41 | struct TodayPlugin { | 41 | struct TodayPlugin { |
42 | TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} | ||
42 | QLibrary *library; | 43 | QLibrary *library; |
43 | TodayPluginInterface *iface; | 44 | QInterfacePtr<TodayPluginInterface> iface; |
44 | TodayPluginObject *guiPart; | 45 | TodayPluginObject *guiPart; |
45 | QWidget *guiBox; | 46 | QWidget *guiBox; |
46 | QString name; | 47 | QString name; |
47 | bool active; | 48 | bool active; |
48 | bool excludeRefresh; | 49 | bool excludeRefresh; |
49 | int pos; | 50 | int pos; |
50 | }; | 51 | }; |
51 | 52 | ||
@@ -156,38 +157,37 @@ void Today::loadPlugins() { | |||
156 | } else { | 157 | } else { |
157 | (*tit).library->unload(); | 158 | (*tit).library->unload(); |
158 | delete (*tit).library; | 159 | delete (*tit).library; |
159 | } | 160 | } |
160 | } | 161 | } |
161 | pluginList.clear(); | 162 | pluginList.clear(); |
162 | } | 163 | } |
163 | 164 | ||
164 | |||
165 | QString path = QPEApplication::qpeDir() + "/plugins/today"; | 165 | QString path = QPEApplication::qpeDir() + "/plugins/today"; |
166 | QDir dir( path, "lib*.so" ); | 166 | QDir dir( path, "lib*.so" ); |
167 | 167 | ||
168 | QStringList list = dir.entryList(); | 168 | QStringList list = dir.entryList(); |
169 | QStringList::Iterator it; | 169 | QStringList::Iterator it; |
170 | 170 | ||
171 | QMap<QString, TodayPlugin> tempList; | 171 | QMap<QString, TodayPlugin> tempList; |
172 | 172 | ||
173 | for ( it = list.begin(); it != list.end(); ++it ) { | 173 | for ( it = list.begin(); it != list.end(); ++it ) { |
174 | TodayPluginInterface *iface = 0; | 174 | //TodayPluginInterface *iface = 0; |
175 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 175 | QInterfacePtr<TodayPluginInterface> iface; |
176 | QLibrary *lib = new QLibrary( path + "/" + *it ); | ||
176 | 177 | ||
177 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | 178 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); |
178 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 179 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
179 | qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); | 180 | qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); |
180 | qDebug( QString(*it) ); | 181 | qDebug( QString(*it) ); |
181 | 182 | ||
182 | // If plugin is exludes from refresh, get it in the list again here. | 183 | // If plugin is exludes from refresh, get it in the list again here. |
183 | 184 | ||
184 | if ( pluginListRefreshExclude.contains( (*it) ) ) { | 185 | if ( pluginListRefreshExclude.contains( (*it) ) ) { |
185 | |||
186 | // if its not in allApplets list, add it to a layout | 186 | // if its not in allApplets list, add it to a layout |
187 | if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) { | 187 | if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) { |
188 | qDebug( "NUGASDA" ); | 188 | qDebug( "NUGASDA" ); |
189 | layout->addWidget( pluginListRefreshExclude[(*it)].guiBox ); | 189 | layout->addWidget( pluginListRefreshExclude[(*it)].guiBox ); |
190 | pluginList.append( pluginListRefreshExclude[(*it)] ); | 190 | pluginList.append( pluginListRefreshExclude[(*it)] ); |
191 | } else { | 191 | } else { |
192 | tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); | 192 | tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); |
193 | qDebug( "TEST2 " + pluginListRefreshExclude[(*it)].name ); | 193 | qDebug( "TEST2 " + pluginListRefreshExclude[(*it)].name ); |
@@ -238,17 +238,17 @@ void Today::loadPlugins() { | |||
238 | 238 | ||
239 | // on first start the list is off course empty | 239 | // on first start the list is off course empty |
240 | if ( m_allApplets.isEmpty() ) { | 240 | if ( m_allApplets.isEmpty() ) { |
241 | layout->addWidget( plugin.guiBox ); | 241 | layout->addWidget( plugin.guiBox ); |
242 | pluginList.append( plugin ); | 242 | pluginList.append( plugin ); |
243 | } | 243 | } |
244 | 244 | ||
245 | // if plugin is not yet in the list, add it to the layout too | 245 | // if plugin is not yet in the list, add it to the layout too |
246 | if ( !m_allApplets.contains( plugin.name ) ) { | 246 | else if ( !m_allApplets.contains( plugin.name ) ) { |
247 | layout->addWidget( plugin.guiBox ); | 247 | layout->addWidget( plugin.guiBox ); |
248 | pluginList.append( plugin ); | 248 | pluginList.append( plugin ); |
249 | } | 249 | } |
250 | } | 250 | } |
251 | } else { | 251 | } else { |
252 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); | 252 | qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); |
253 | delete lib; | 253 | delete lib; |
254 | } | 254 | } |