summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginimpl.cpp1
-rw-r--r--core/pim/today/today.cpp12
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
@@ -21,8 +21,9 @@ DatebookPluginImpl::DatebookPluginImpl() {
datebookPlugin = new DatebookPlugin();
}
DatebookPluginImpl::~DatebookPluginImpl() {
+ delete datebookPlugin;
}
TodayPluginObject* DatebookPluginImpl::guiPart() {
return datebookPlugin;
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
@@ -38,10 +38,11 @@
#include <qwhatsthis.h>
struct TodayPlugin {
+ TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
QLibrary *library;
- TodayPluginInterface *iface;
+ QInterfacePtr<TodayPluginInterface> iface;
TodayPluginObject *guiPart;
QWidget *guiBox;
QString name;
bool active;
@@ -160,9 +161,8 @@ void Today::loadPlugins() {
}
pluginList.clear();
}
-
QString path = QPEApplication::qpeDir() + "/plugins/today";
QDir dir( path, "lib*.so" );
QStringList list = dir.entryList();
@@ -170,10 +170,11 @@ void Today::loadPlugins() {
QMap<QString, TodayPlugin> tempList;
for ( it = list.begin(); it != list.end(); ++it ) {
- TodayPluginInterface *iface = 0;
- QLibrary *lib = new QLibrary( path + "/" + *it );
+// TodayPluginInterface *iface = 0;
+ QInterfacePtr<TodayPluginInterface> iface;
+ QLibrary *lib = new QLibrary( path + "/" + *it );
qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
qDebug( "loading: %s", QString( path + "/" + *it ).latin1() );
@@ -181,9 +182,8 @@ void Today::loadPlugins() {
// If plugin is exludes from refresh, get it in the list again here.
if ( pluginListRefreshExclude.contains( (*it) ) ) {
-
// if its not in allApplets list, add it to a layout
if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) {
qDebug( "NUGASDA" );
layout->addWidget( pluginListRefreshExclude[(*it)].guiBox );
@@ -242,9 +242,9 @@ void Today::loadPlugins() {
pluginList.append( plugin );
}
// if plugin is not yet in the list, add it to the layout too
- if ( !m_allApplets.contains( plugin.name ) ) {
+ else if ( !m_allApplets.contains( plugin.name ) ) {
layout->addWidget( plugin.guiBox );
pluginList.append( plugin );
}
}