Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index a7f6691..8ae4f84 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -248,2 +248,3 @@ void DateBook::slotSettings() | |||
248 | frmSettings.comboWeekListView->setCurrentItem(weeklistviewconfig); | 248 | frmSettings.comboWeekListView->setCurrentItem(weeklistviewconfig); |
249 | frmSettings.setPluginList(db_holiday->pluginManager(),db_holiday->pluginLoader()); | ||
249 | 250 | ||
@@ -264,2 +265,5 @@ void DateBook::slotSettings() | |||
264 | if ( QPEApplication::execDialog( &frmSettings ) ) { | 265 | if ( QPEApplication::execDialog( &frmSettings ) ) { |
266 | db_holiday->pluginManager()->save(); | ||
267 | db_holiday->reloadPlugins(); | ||
268 | |||
265 | aPreset = frmSettings.alarmPreset(); | 269 | aPreset = frmSettings.alarmPreset(); |
@@ -1091,2 +1095,11 @@ DateBookHoliday::DateBookHoliday() | |||
1091 | m_pluginLoader->setAutoDelete(true); | 1095 | m_pluginLoader->setAutoDelete(true); |
1096 | m_pluginManager = new Opie::Core::OPluginManager(m_pluginLoader); | ||
1097 | m_pluginManager->load(); | ||
1098 | |||
1099 | init(); | ||
1100 | } | ||
1101 | |||
1102 | void DateBookHoliday::reloadPlugins() | ||
1103 | { | ||
1104 | deinit(); | ||
1092 | init(); | 1105 | init(); |
@@ -1098,2 +1111,3 @@ DateBookHoliday::~DateBookHoliday() | |||
1098 | delete m_pluginLoader; | 1111 | delete m_pluginLoader; |
1112 | delete m_pluginManager; | ||
1099 | } | 1113 | } |
@@ -1102,3 +1116,2 @@ void DateBookHoliday::deinit() | |||
1102 | { | 1116 | { |
1103 | /* | ||
1104 | QValueList<HPlugin*>::Iterator it; | 1117 | QValueList<HPlugin*>::Iterator it; |
@@ -1106,6 +1119,3 @@ void DateBookHoliday::deinit() | |||
1106 | HPlugin*_pl = *it; | 1119 | HPlugin*_pl = *it; |
1107 | // destructs itself? | 1120 | *it = 0; |
1108 | _pl->_if->release(); | ||
1109 | _pl->_lib->unload(); | ||
1110 | delete _pl->_lib; | ||
1111 | delete _pl; | 1121 | delete _pl; |
@@ -1113,3 +1123,2 @@ void DateBookHoliday::deinit() | |||
1113 | _pluginlist.clear(); | 1123 | _pluginlist.clear(); |
1114 | */ | ||
1115 | } | 1124 | } |
@@ -1125,6 +1134,5 @@ void DateBookHoliday::init() | |||
1125 | { | 1134 | { |
1126 | #if 0 | ||
1127 | deinit(); | 1135 | deinit(); |
1128 | #endif | 1136 | |
1129 | Opie::Core::OPluginItem::List lst = m_pluginLoader->allAvailable( false ); | 1137 | Opie::Core::OPluginItem::List lst = m_pluginLoader->filtered(true); |
1130 | // debugLst( lst ); | 1138 | // debugLst( lst ); |
@@ -1143,26 +1151,2 @@ void DateBookHoliday::init() | |||
1143 | } | 1151 | } |
1144 | #if 0 | ||
1145 | QString path = QPEApplication::qpeDir() + "plugins/datebook/holiday"; | ||
1146 | QDir dir( path, "lib*.so" ); | ||
1147 | QStringList list = dir.entryList(); | ||
1148 | QStringList::Iterator it; | ||
1149 | for (it=list.begin();it!=list.end();++it) { | ||
1150 | Opie::Datebook::HolidayPluginIf*hif = 0; | ||
1151 | QLibrary*lib=new QLibrary(path+"/"+*it); | ||
1152 | if ((lib->queryInterface(IID_HOLIDAY_PLUGIN,(QUnknownInterface**)&hif) == QS_OK) && hif) { | ||
1153 | Opie::Datebook::HolidayPlugin*pl = hif->plugin(); | ||
1154 | if (pl) { | ||
1155 | HPlugin*_pl=new HPlugin; | ||
1156 | _pl->_plugin = pl; | ||
1157 | odebug << "Found holiday " << pl->description()<<oendl; | ||
1158 | _pl->_lib = lib; | ||
1159 | _pl->_if = hif; | ||
1160 | _pluginlist.append(_pl); | ||
1161 | } else { | ||
1162 | } | ||
1163 | } else { | ||
1164 | delete lib; | ||
1165 | } | ||
1166 | } | ||
1167 | #endif | ||
1168 | } | 1152 | } |