Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index f6aab0c..36c4bd7 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -75,9 +75,10 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) | |||
75 | bool needEvilHack= false; // if we need an Evil Hack | 75 | bool needEvilHack= false; // if we need an Evil Hack |
76 | QTime t; | 76 | QTime t; |
77 | t.start(); | 77 | t.start(); |
78 | db = new DateBookDBHack; | 78 | db = new DateBookDBHoliday; |
79 | odebug << "loading db t=" << t.elapsed() << oendl; | 79 | odebug << "loading db t=" << t.elapsed() << oendl; |
80 | db_holiday = new DateBookHoliday(); | 80 | db_holiday = new DateBookHoliday(); |
81 | db->db_holiday=db_holiday; | ||
81 | 82 | ||
82 | loadSettings(); | 83 | loadSettings(); |
83 | setCaption( tr("Calendar") ); | 84 | setCaption( tr("Calendar") ); |
@@ -1149,3 +1150,45 @@ QStringList DateBookHoliday::holidaylist(unsigned year, unsigned month, unsigned | |||
1149 | return holidaylist(QDate(year,month,day)); | 1150 | return holidaylist(QDate(year,month,day)); |
1150 | } | 1151 | } |
1151 | 1152 | ||
1153 | QValueList<EffectiveEvent> DateBookHoliday::getEffectiveEvents(const QDate &from,const QDate &to ) | ||
1154 | { | ||
1155 | QValueList<EffectiveEvent> ret; | ||
1156 | QValueList<HPlugin*>::Iterator it; | ||
1157 | for (it=_pluginlist.begin();it!=_pluginlist.end();++it) { | ||
1158 | HPlugin*_pl = *it; | ||
1159 | ret+=_pl->_plugin->events(from,to); | ||
1160 | } | ||
1161 | return ret; | ||
1162 | } | ||
1163 | |||
1164 | QValueList<EffectiveEvent> DateBookDBHoliday::getEffectiveEventsNoHoliday(const QDate &from,const QDate &to ) | ||
1165 | { | ||
1166 | return DateBookDBHack::getEffectiveEvents(from,to); | ||
1167 | } | ||
1168 | |||
1169 | QValueList<EffectiveEvent> DateBookDBHoliday::getEffectiveEventsNoHoliday(const QDateTime &start) | ||
1170 | { | ||
1171 | return DateBookDBHack::getEffectiveEvents(start); | ||
1172 | } | ||
1173 | |||
1174 | QValueList<EffectiveEvent> DateBookHoliday::getEffectiveEvents(const QDateTime &start) | ||
1175 | { | ||
1176 | return getEffectiveEvents(start.date(),start.date()); | ||
1177 | } | ||
1178 | |||
1179 | QValueList<EffectiveEvent> DateBookDBHoliday::getEffectiveEvents(const QDate &from,const QDate &to ) | ||
1180 | { | ||
1181 | QValueList<EffectiveEvent> ret; | ||
1182 | odebug << "Ueberlagert 1" << oendl; | ||
1183 | if (db_holiday) { | ||
1184 | ret+=db_holiday->getEffectiveEvents(from,to); | ||
1185 | } | ||
1186 | ret+=getEffectiveEventsNoHoliday(from,to); | ||
1187 | return ret; | ||
1188 | } | ||
1189 | |||
1190 | QValueList<EffectiveEvent> DateBookDBHoliday::getEffectiveEvents( const QDateTime &start) | ||
1191 | { | ||
1192 | odebug << "Ueberlagert 2" << oendl; | ||
1193 | return DateBookDBHack::getEffectiveEvents(start); | ||
1194 | } | ||