summaryrefslogtreecommitdiff
path: root/core/pim/datebook
Side-by-side diff
Diffstat (limited to 'core/pim/datebook') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp25
-rw-r--r--core/pim/datebook/datebook.h7
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 )
t.start();
- db = new DateBookDB;
+ db = new DateBookDBHack;
qDebug("loading db t=%d", t.elapsed() );
@@ -235,3 +235,3 @@ void DateBook::receive( const QCString &msg, const QByteArray &data )
stream >> uid;
- Event e=db->getEvent(uid);
+ Event e=db->eventByUID(uid);
editEvent(e);
@@ -967 +967,22 @@ void DateBook::slotDoFind( const QString& txt, const QDate &dt,
}
+
+Event DateBookDBHack::eventByUID(int uid) {
+
+ // FIXME: Dirty Hacks to get hold of the private event lists
+ QDate start;
+ QDate end=start.addDays(-1);
+ QValueList<Event> myEventList=getNonRepeatingEvents(start,end);
+ QValueList<Event> myRepeatEvents=getRawRepeats();
+
+ QValueList<Event>::ConstIterator it;
+
+ for (it = myEventList.begin(); it != myEventList.end(); it++) {
+ if ((*it).uid() == uid) return *it;
+ }
+ for (it = myRepeatEvents.begin(); it != myRepeatEvents.end(); it++) {
+ if ((*it).uid() == uid) return *it;
+ }
+
+ qDebug("Event not found: uid=%d\n", uid);
+}
+
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;
+class DateBookDBHack : public DateBookDB {
+ public:
+ Event eventByUID(int id);
+};
+
class DateBook : public QMainWindow
@@ -101,3 +106,3 @@ private:
private:
- DateBookDB *db;
+ DateBookDBHack *db;
QWidgetStack *views;