author | alwin <alwin> | 2005-03-18 12:49:14 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-18 12:49:14 (UTC) |
commit | b7996a25adab32e6f2e4d278a9d9801ad66f90c7 (patch) (side-by-side diff) | |
tree | f90bf3aa5cd274c467a8ff3e84566fdfa6a1a6c5 /core/pim/datebook/datebook.cpp | |
parent | d7fdcc3dac4a1d8cbd823d17ea52d17cb67b16f8 (diff) | |
download | opie-b7996a25adab32e6f2e4d278a9d9801ad66f90c7.zip opie-b7996a25adab32e6f2e4d278a9d9801ad66f90c7.tar.gz opie-b7996a25adab32e6f2e4d278a9d9801ad66f90c7.tar.bz2 |
made plugins configureable, eg, if them will load or not (or switch on/off
at runtime)
events generated from plugins will not editable and so on (check for a
wrong Uid) so them are just text inside datebook.
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() frmSettings.comboWeekListView->setCurrentItem(weeklistviewconfig); + frmSettings.setPluginList(db_holiday->pluginManager(),db_holiday->pluginLoader()); @@ -264,2 +265,5 @@ void DateBook::slotSettings() if ( QPEApplication::execDialog( &frmSettings ) ) { + db_holiday->pluginManager()->save(); + db_holiday->reloadPlugins(); + aPreset = frmSettings.alarmPreset(); @@ -1091,2 +1095,11 @@ DateBookHoliday::DateBookHoliday() m_pluginLoader->setAutoDelete(true); + m_pluginManager = new Opie::Core::OPluginManager(m_pluginLoader); + m_pluginManager->load(); + + init(); +} + +void DateBookHoliday::reloadPlugins() +{ + deinit(); init(); @@ -1098,2 +1111,3 @@ DateBookHoliday::~DateBookHoliday() delete m_pluginLoader; + delete m_pluginManager; } @@ -1102,3 +1116,2 @@ void DateBookHoliday::deinit() { -/* QValueList<HPlugin*>::Iterator it; @@ -1106,6 +1119,3 @@ void DateBookHoliday::deinit() HPlugin*_pl = *it; - // destructs itself? - _pl->_if->release(); - _pl->_lib->unload(); - delete _pl->_lib; + *it = 0; delete _pl; @@ -1113,3 +1123,2 @@ void DateBookHoliday::deinit() _pluginlist.clear(); -*/ } @@ -1125,6 +1134,5 @@ void DateBookHoliday::init() { -#if 0 deinit(); -#endif - Opie::Core::OPluginItem::List lst = m_pluginLoader->allAvailable( false ); + + Opie::Core::OPluginItem::List lst = m_pluginLoader->filtered(true); // debugLst( lst ); @@ -1143,26 +1151,2 @@ void DateBookHoliday::init() } -#if 0 - QString path = QPEApplication::qpeDir() + "plugins/datebook/holiday"; - QDir dir( path, "lib*.so" ); - QStringList list = dir.entryList(); - QStringList::Iterator it; - for (it=list.begin();it!=list.end();++it) { - Opie::Datebook::HolidayPluginIf*hif = 0; - QLibrary*lib=new QLibrary(path+"/"+*it); - if ((lib->queryInterface(IID_HOLIDAY_PLUGIN,(QUnknownInterface**)&hif) == QS_OK) && hif) { - Opie::Datebook::HolidayPlugin*pl = hif->plugin(); - if (pl) { - HPlugin*_pl=new HPlugin; - _pl->_plugin = pl; - odebug << "Found holiday " << pl->description()<<oendl; - _pl->_lib = lib; - _pl->_if = hif; - _pluginlist.append(_pl); - } else { - } - } else { - delete lib; - } - } -#endif } |