-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 @@ #include <qwhatsthis.h> +#include <qmessagebox.h> @@ -56,4 +57,3 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) - #if defined(Q_WS_QWS) - #if !defined(QT_NO_COP) +#if !defined(QT_NO_COP) @@ -62,4 +62,3 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); - #endif - #endif +#endif @@ -86,3 +85,2 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) initialize(); - QPEApplication::showWidget( this ); } @@ -181,4 +179,2 @@ void Today::loadPlugins() { - OPluginItem::List lst = m_pluginLoader->allAvailable( true ); - m_manager = new OPluginManager( m_pluginLoader ); @@ -186,2 +182,17 @@ void Today::loadPlugins() { + /* + * check if loading of Plugins crashed + */ + if( m_pluginLoader->isInSafeMode() ) { + QMessageBox::information(this, tr("Today Error"), + tr("<qt>The plugin '%1' caused Today to crash." + " It could be that the plugin is not properly" + " installed.<br>Today tries to continue loading" + " plugins.</qt>") + .arg( m_manager->crashedPlugin().name())); + } + + OPluginItem::List lst = m_pluginLoader->filtered( true ); + + for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) { @@ -235,3 +246,3 @@ void Today::startConfig() { - if ( conf.exec() == QDialog::Accepted ) { + if ( QPEApplication::execDialog(&conf) == QDialog::Accepted ) { conf.writeConfig(); @@ -346,8 +357,7 @@ void Today::editCard() { Today::~Today() { - if (m_pluginLoader) { - delete m_pluginLoader; - } - if (m_manager) { - delete m_manager; - } + for(QMap<QString, TodayPlugin>::Iterator it = pluginList.begin(); it != pluginList.end(); ++it ) + delete it.data().guiBox; + + delete m_pluginLoader; + delete m_manager; } |