summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp38
-rw-r--r--core/pim/today/today.h1
-rw-r--r--core/pim/today/todayconfig.cpp32
-rw-r--r--core/pim/today/todayconfig.h4
4 files changed, 43 insertions, 32 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() {
346Today::~Today() { 357Today::~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}
diff --git a/core/pim/today/today.h b/core/pim/today/today.h
index c947ae1..dfc819d 100644
--- a/core/pim/today/today.h
+++ b/core/pim/today/today.h
@@ -42,3 +42,2 @@ namespace Opie {
42class Today : public TodayBase { 42class Today : public TodayBase {
43
44 Q_OBJECT 43 Q_OBJECT
diff --git a/core/pim/today/todayconfig.cpp b/core/pim/today/todayconfig.cpp
index c9823d4..dacce8b 100644
--- a/core/pim/today/todayconfig.cpp
+++ b/core/pim/today/todayconfig.cpp
@@ -98,3 +98,2 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
98 readConfig(); 98 readConfig();
99 QPEApplication::showDialog( this );
100} 99}
@@ -103,3 +102,3 @@ TodayConfig::TodayConfig( QWidget* parent, const char* name, bool modal )
103void TodayConfig::setUpPlugins( OPluginManager * plugManager, OPluginLoader *plugLoader ) { 102void TodayConfig::setUpPlugins( OPluginManager * plugManager, OPluginLoader *plugLoader ) {
104 103 m_configMap.clear();
105 104
@@ -115,13 +114,15 @@ void TodayConfig::setUpPlugins( OPluginManager * plugManager, OPluginLoader *plu
115 TodayPluginInterface* iface = m_pluginLoader->load<TodayPluginInterface>( *it, IID_TodayPluginInterface ); 114 TodayPluginInterface* iface = m_pluginLoader->load<TodayPluginInterface>( *it, IID_TodayPluginInterface );
115 TodayConfigWidget *widget = iface->guiPart()->configWidget( TabWidget3 );
116 116
117 if ( iface->guiPart()->configWidget(this) != 0l ) { 117 if (!widget )
118 TodayConfigWidget* widget = iface->guiPart()->configWidget( TabWidget3 ); 118 continue;
119 TabWidget3->addTab( widget, iface->guiPart()->pixmapNameConfig() 119
120 , iface->guiPart()->appName() ); 120 m_configMap.insert( iface, widget );
121 } 121 TabWidget3->addTab( widget, iface->guiPart()->pixmapNameConfig()
122 , iface->guiPart()->appName() );
122 } 123 }
123 124
124 for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) { 125 for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it )
125 pluginManagement( (*it) ); 126 pluginManagement( (*it) );
126 } 127
127 128
@@ -176,6 +177,6 @@ void TodayConfig::writeConfig() {
176 QListViewItemIterator list_it( m_appletListView ); 177 QListViewItemIterator list_it( m_appletListView );
177 // 178 OPluginItem::List lst = m_pluginLoader->allAvailable( true );
179
178 // this makes sure the names get saved in the order selected 180 // this makes sure the names get saved in the order selected
179 for ( ; list_it.current(); ++list_it ) { 181 for ( ; list_it.current(); ++list_it ) {
180 OPluginItem::List lst = m_pluginLoader->allAvailable( true );
181 for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) { 182 for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) {
@@ -205,8 +206,7 @@ void TodayConfig::writeConfig() {
205 206
206 OPluginItem::List lst = m_pluginManager->managedPlugins(); 207 OPluginItem::List managedLst = m_pluginManager->managedPlugins();
207 for ( OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ) { 208 for ( OPluginItem::List::Iterator it = managedLst.begin(); it != managedLst.end(); ++it ) {
208 TodayPluginInterface* iface = m_pluginLoader->load<TodayPluginInterface>( *it, IID_TodayPluginInterface ); 209 TodayPluginInterface* iface = m_pluginLoader->load<TodayPluginInterface>( *it, IID_TodayPluginInterface );
209 if ( iface->guiPart()->configWidget(this) != 0l ) { 210 if ( m_configMap.contains( iface ) )
210 iface->guiPart()->configWidget(this)->writeConfig(); 211 m_configMap[iface]->writeConfig();
211 }
212 } 212 }
diff --git a/core/pim/today/todayconfig.h b/core/pim/today/todayconfig.h
index ab79f31..81120d3 100644
--- a/core/pim/today/todayconfig.h
+++ b/core/pim/today/todayconfig.h
@@ -32,2 +32,4 @@ class QSpinBox;
32class QTabWidget; 32class QTabWidget;
33class TodayConfigWidget;
34class TodayPluginInterface;
33 35
@@ -42,3 +44,2 @@ namespace Opie {
42class TodayConfig : public QDialog { 44class TodayConfig : public QDialog {
43
44 Q_OBJECT 45 Q_OBJECT
@@ -66,2 +67,3 @@ private:
66 QMap<QString,QCheckListItem*> m_applets; 67 QMap<QString,QCheckListItem*> m_applets;
68 QMap<TodayPluginInterface*,TodayConfigWidget*> m_configMap;
67 69