-rw-r--r-- | core/pim/datebook/datebook.cpp | 33 | ||||
-rw-r--r-- | core/pim/datebook/datebooktypes.h | 8 |
2 files changed, 39 insertions, 2 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index 36c4bd7..a7f6691 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -34,2 +34,4 @@ | |||
34 | #include <opie2/oholidayplugin.h> | 34 | #include <opie2/oholidayplugin.h> |
35 | #include <opie2/opluginloader.h> | ||
36 | #include <opie2/todayplugininterface.h> | ||
35 | 37 | ||
@@ -1087,2 +1089,4 @@ DateBookHoliday::DateBookHoliday() | |||
1087 | _pluginlist.clear(); | 1089 | _pluginlist.clear(); |
1090 | m_pluginLoader = new Opie::Core::OPluginLoader("holidays",false); | ||
1091 | m_pluginLoader->setAutoDelete(true); | ||
1088 | init(); | 1092 | init(); |
@@ -1093,2 +1097,3 @@ DateBookHoliday::~DateBookHoliday() | |||
1093 | deinit(); | 1097 | deinit(); |
1098 | delete m_pluginLoader; | ||
1094 | } | 1099 | } |
@@ -1097,2 +1102,3 @@ void DateBookHoliday::deinit() | |||
1097 | { | 1102 | { |
1103 | /* | ||
1098 | QValueList<HPlugin*>::Iterator it; | 1104 | QValueList<HPlugin*>::Iterator it; |
@@ -1107,7 +1113,33 @@ void DateBookHoliday::deinit() | |||
1107 | _pluginlist.clear(); | 1113 | _pluginlist.clear(); |
1114 | */ | ||
1108 | } | 1115 | } |
1109 | 1116 | ||
1117 | #if 0 | ||
1118 | void debugLst( const Opie::Core::OPluginItem::List& lst ) { | ||
1119 | for ( Opie::Core::OPluginItem::List::ConstIterator it = lst.begin(); it != lst.end(); ++it ) | ||
1120 | odebug << "Name " << (*it).name() << " " << (*it).path() << " " << (*it).position() << oendl; | ||
1121 | } | ||
1122 | #endif | ||
1123 | |||
1110 | void DateBookHoliday::init() | 1124 | void DateBookHoliday::init() |
1111 | { | 1125 | { |
1126 | #if 0 | ||
1112 | deinit(); | 1127 | deinit(); |
1128 | #endif | ||
1129 | Opie::Core::OPluginItem::List lst = m_pluginLoader->allAvailable( false ); | ||
1130 | // debugLst( lst ); | ||
1131 | for( Opie::Core::OPluginItem::List::Iterator it = lst.begin(); it != lst.end(); ++it ){ | ||
1132 | Opie::Datebook::HolidayPluginIf*hif = m_pluginLoader->load<Opie::Datebook::HolidayPluginIf>(*it,IID_HOLIDAY_PLUGIN); | ||
1133 | if (hif) { | ||
1134 | Opie::Datebook::HolidayPlugin*pl = hif->plugin(); | ||
1135 | if (pl) { | ||
1136 | HPlugin*_pl=new HPlugin; | ||
1137 | _pl->_plugin = pl; | ||
1138 | odebug << "Found holiday " << pl->description()<<oendl; | ||
1139 | _pluginlist.append(_pl); | ||
1140 | //_pl->_if = hif; | ||
1141 | } | ||
1142 | } | ||
1143 | } | ||
1144 | #if 0 | ||
1113 | QString path = QPEApplication::qpeDir() + "plugins/datebook/holiday"; | 1145 | QString path = QPEApplication::qpeDir() + "plugins/datebook/holiday"; |
@@ -1134,2 +1166,3 @@ void DateBookHoliday::init() | |||
1134 | } | 1166 | } |
1167 | #endif | ||
1135 | } | 1168 | } |
diff --git a/core/pim/datebook/datebooktypes.h b/core/pim/datebook/datebooktypes.h index 9eb7e89..f944e84 100644 --- a/core/pim/datebook/datebooktypes.h +++ b/core/pim/datebook/datebooktypes.h | |||
@@ -13,2 +13,5 @@ namespace Datebook { | |||
13 | } | 13 | } |
14 | namespace Core { | ||
15 | class OPluginLoader; | ||
16 | } | ||
14 | } | 17 | } |
@@ -40,6 +43,7 @@ protected: | |||
40 | Opie::Datebook::HolidayPlugin*_plugin; | 43 | Opie::Datebook::HolidayPlugin*_plugin; |
41 | QLibrary*_lib; | 44 | //QLibrary*_lib; |
42 | Opie::Datebook::HolidayPluginIf*_if; | 45 | //Opie::Datebook::HolidayPluginIf*_if; |
43 | }; | 46 | }; |
44 | QValueList<HPlugin*>_pluginlist; | 47 | QValueList<HPlugin*>_pluginlist; |
48 | Opie::Core::OPluginLoader*m_pluginLoader; | ||
45 | }; | 49 | }; |