From 7edc36774d1deec4806ee9273e25a059f9ac1f9e Mon Sep 17 00:00:00 2001 From: harlekin Date: Thu, 21 Nov 2002 16:25:44 +0000 Subject: using now QInterfacePtr as Simon suggested, and another leak fix in datebook plugin --- (limited to 'core/pim') 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 @@ -22,6 +22,7 @@ DatebookPluginImpl::DatebookPluginImpl() { } DatebookPluginImpl::~DatebookPluginImpl() { + delete datebookPlugin; } TodayPluginObject* DatebookPluginImpl::guiPart() { 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 @@ -39,8 +39,9 @@ struct TodayPlugin { + TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {} QLibrary *library; - TodayPluginInterface *iface; + QInterfacePtr iface; TodayPluginObject *guiPart; QWidget *guiBox; QString name; @@ -161,7 +162,6 @@ void Today::loadPlugins() { pluginList.clear(); } - QString path = QPEApplication::qpeDir() + "/plugins/today"; QDir dir( path, "lib*.so" ); @@ -171,8 +171,9 @@ void Today::loadPlugins() { QMap tempList; for ( it = list.begin(); it != list.end(); ++it ) { - TodayPluginInterface *iface = 0; - QLibrary *lib = new QLibrary( path + "/" + *it ); +// TodayPluginInterface *iface = 0; + QInterfacePtr iface; + QLibrary *lib = new QLibrary( path + "/" + *it ); qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { @@ -182,7 +183,6 @@ 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" ); @@ -243,7 +243,7 @@ void Today::loadPlugins() { } // 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 ); } -- cgit v0.9.0.2