author | zecke <zecke> | 2004-09-12 20:31:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-12 20:31:20 (UTC) |
commit | b52e2e46ec535a5307276b8fdf1e578aa5d29283 (patch) (unidiff) | |
tree | f30d0fd2faaf89c2bc982e3f8a645645bf74edd8 /core/pim/today/today.cpp | |
parent | 90aaa298cc69522e88e1f81ade7d5259131b1544 (diff) | |
download | opie-b52e2e46ec535a5307276b8fdf1e578aa5d29283.zip opie-b52e2e46ec535a5307276b8fdf1e578aa5d29283.tar.gz opie-b52e2e46ec535a5307276b8fdf1e578aa5d29283.tar.bz2 |
-Only create configWidgets once per config dialog, properly delete them
-Delete the Widgets before we remove the plugin from our address space
some random clean ups
-rw-r--r-- | core/pim/today/today.cpp | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index a8c8651..be7cbce 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -30,2 +30,3 @@ | |||
30 | #include <qwhatsthis.h> | 30 | #include <qwhatsthis.h> |
31 | #include <qmessagebox.h> | ||
31 | 32 | ||
@@ -56,4 +57,3 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) | |||
56 | 57 | ||
57 | #if defined(Q_WS_QWS) | 58 | #if !defined(QT_NO_COP) |
58 | #if !defined(QT_NO_COP) | ||
59 | 59 | ||
@@ -62,4 +62,3 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) | |||
62 | this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); | 62 | this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); |
63 | #endif | 63 | #endif |
64 | #endif | ||
65 | 64 | ||
@@ -86,3 +85,2 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) | |||
86 | initialize(); | 85 | initialize(); |
87 | QPEApplication::showWidget( this ); | ||
88 | } | 86 | } |
@@ -181,4 +179,2 @@ void Today::loadPlugins() { | |||
181 | 179 | ||
182 | OPluginItem::List lst = m_pluginLoader->allAvailable( true ); | ||
183 | |||
184 | m_manager = new OPluginManager( m_pluginLoader ); | 180 | m_manager = new OPluginManager( m_pluginLoader ); |
@@ -186,2 +182,17 @@ void Today::loadPlugins() { | |||
186 | 182 | ||
183 | /* | ||
184 | * check if loading of Plugins crashed | ||
185 | */ | ||
186 | if( m_pluginLoader->isInSafeMode() ) { | ||
187 | QMessageBox::information(this, tr("Today Error"), | ||
188 | tr("<qt>The plugin '%1' caused Today to crash." | ||
189 | " It could be that the plugin is not properly" | ||
190 | " installed.<br>Today tries to continue loading" | ||
191 | " plugins.</qt>") | ||
192 | .arg( m_manager->crashedPlugin().name())); | ||
193 | } | ||
194 | |||
195 | OPluginItem::List lst = m_pluginLoader->filtered( true ); | ||
196 | |||
197 | |||
187 | for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) { | 198 | for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) { |
@@ -235,3 +246,3 @@ void Today::startConfig() { | |||
235 | 246 | ||
236 | if ( conf.exec() == QDialog::Accepted ) { | 247 | if ( QPEApplication::execDialog(&conf) == QDialog::Accepted ) { |
237 | conf.writeConfig(); | 248 | conf.writeConfig(); |
@@ -346,8 +357,7 @@ void Today::editCard() { | |||
346 | Today::~Today() { | 357 | Today::~Today() { |
347 | if (m_pluginLoader) { | 358 | for(QMap<QString, TodayPlugin>::Iterator it = pluginList.begin(); it != pluginList.end(); ++it ) |
348 | delete m_pluginLoader; | 359 | delete it.data().guiBox; |
349 | } | 360 | |
350 | if (m_manager) { | 361 | delete m_pluginLoader; |
351 | delete m_manager; | 362 | delete m_manager; |
352 | } | ||
353 | } | 363 | } |