-rw-r--r-- | core/pim/datebook/datebook.cpp | 25 | ||||
-rw-r--r-- | core/pim/datebook/datebook.h | 7 |
2 files changed, 29 insertions, 3 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index 97c305c..c23129a 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -86,3 +86,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) | |||
86 | t.start(); | 86 | t.start(); |
87 | db = new DateBookDB; | 87 | db = new DateBookDBHack; |
88 | qDebug("loading db t=%d", t.elapsed() ); | 88 | qDebug("loading db t=%d", t.elapsed() ); |
@@ -235,3 +235,3 @@ void DateBook::receive( const QCString &msg, const QByteArray &data ) | |||
235 | stream >> uid; | 235 | stream >> uid; |
236 | Event e=db->getEvent(uid); | 236 | Event e=db->eventByUID(uid); |
237 | editEvent(e); | 237 | editEvent(e); |
@@ -967 +967,22 @@ void DateBook::slotDoFind( const QString& txt, const QDate &dt, | |||
967 | } | 967 | } |
968 | |||
969 | Event DateBookDBHack::eventByUID(int uid) { | ||
970 | |||
971 | // FIXME: Dirty Hacks to get hold of the private event lists | ||
972 | QDate start; | ||
973 | QDate end=start.addDays(-1); | ||
974 | QValueList<Event> myEventList=getNonRepeatingEvents(start,end); | ||
975 | QValueList<Event> myRepeatEvents=getRawRepeats(); | ||
976 | |||
977 | QValueList<Event>::ConstIterator it; | ||
978 | |||
979 | for (it = myEventList.begin(); it != myEventList.end(); it++) { | ||
980 | if ((*it).uid() == uid) return *it; | ||
981 | } | ||
982 | for (it = myRepeatEvents.begin(); it != myRepeatEvents.end(); it++) { | ||
983 | if ((*it).uid() == uid) return *it; | ||
984 | } | ||
985 | |||
986 | qDebug("Event not found: uid=%d\n", uid); | ||
987 | } | ||
988 | |||
diff --git a/core/pim/datebook/datebook.h b/core/pim/datebook/datebook.h index 2ffcdbe..d1fe90d 100644 --- a/core/pim/datebook/datebook.h +++ b/core/pim/datebook/datebook.h | |||
@@ -36,2 +36,7 @@ class Ir; | |||
36 | 36 | ||
37 | class DateBookDBHack : public DateBookDB { | ||
38 | public: | ||
39 | Event eventByUID(int id); | ||
40 | }; | ||
41 | |||
37 | class DateBook : public QMainWindow | 42 | class DateBook : public QMainWindow |
@@ -101,3 +106,3 @@ private: | |||
101 | private: | 106 | private: |
102 | DateBookDB *db; | 107 | DateBookDBHack *db; |
103 | QWidgetStack *views; | 108 | QWidgetStack *views; |