summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebook.cpp
authoralwin <alwin>2005-03-17 14:01:23 (UTC)
committer alwin <alwin>2005-03-17 14:01:23 (UTC)
commit8752141a5341877369f89a42fa1f0b5d08f56dbd (patch) (side-by-side diff)
tree63dc48ee207a4e9fbb6b9e8abddb239ec724c155 /core/pim/datebook/datebook.cpp
parentafee05f4b4c1e8dab8463e3423fcfc8f9d45aa8b (diff)
downloadopie-8752141a5341877369f89a42fa1f0b5d08f56dbd.zip
opie-8752141a5341877369f89a42fa1f0b5d08f56dbd.tar.gz
opie-8752141a5341877369f89a42fa1f0b5d08f56dbd.tar.bz2
1. datebookweeklist - a week has SEVEN days, not SIX. I'm wondering why
events on sunday never showed there ;) 2. extra file datebooktypes contains some special classes used by datebook so other classes must not include the big mainheader file. 3. added support for holiday-plugins to week-views. Month view is a little bit more tricky 'cause TT has never heard about virtual methods and so I have the choice between complete copy the monthview and make the modifications or changing the interface of datebookdb-class to virtual. both isn't nice.
Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp45
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 )
bool needEvilHack= false; // if we need an Evil Hack
QTime t;
t.start();
- db = new DateBookDBHack;
+ db = new DateBookDBHoliday;
odebug << "loading db t=" << t.elapsed() << oendl;
db_holiday = new DateBookHoliday();
+ db->db_holiday=db_holiday;
loadSettings();
setCaption( tr("Calendar") );
@@ -1149,3 +1150,45 @@ QStringList DateBookHoliday::holidaylist(unsigned year, unsigned month, unsigned
return holidaylist(QDate(year,month,day));
}
+QValueList<EffectiveEvent> DateBookHoliday::getEffectiveEvents(const QDate &from,const QDate &to )
+{
+ QValueList<EffectiveEvent> ret;
+ QValueList<HPlugin*>::Iterator it;
+ for (it=_pluginlist.begin();it!=_pluginlist.end();++it) {
+ HPlugin*_pl = *it;
+ ret+=_pl->_plugin->events(from,to);
+ }
+ return ret;
+}
+
+QValueList<EffectiveEvent> DateBookDBHoliday::getEffectiveEventsNoHoliday(const QDate &from,const QDate &to )
+{
+ return DateBookDBHack::getEffectiveEvents(from,to);
+}
+
+QValueList<EffectiveEvent> DateBookDBHoliday::getEffectiveEventsNoHoliday(const QDateTime &start)
+{
+ return DateBookDBHack::getEffectiveEvents(start);
+}
+
+QValueList<EffectiveEvent> DateBookHoliday::getEffectiveEvents(const QDateTime &start)
+{
+ return getEffectiveEvents(start.date(),start.date());
+}
+
+QValueList<EffectiveEvent> DateBookDBHoliday::getEffectiveEvents(const QDate &from,const QDate &to )
+{
+ QValueList<EffectiveEvent> ret;
+ odebug << "Ueberlagert 1" << oendl;
+ if (db_holiday) {
+ ret+=db_holiday->getEffectiveEvents(from,to);
+ }
+ ret+=getEffectiveEventsNoHoliday(from,to);
+ return ret;
+}
+
+QValueList<EffectiveEvent> DateBookDBHoliday::getEffectiveEvents( const QDateTime &start)
+{
+ odebug << "Ueberlagert 2" << oendl;
+ return DateBookDBHack::getEffectiveEvents(start);
+}