Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 25 |
1 files changed, 23 insertions, 2 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 | |||
@@ -81,13 +81,13 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) | |||
81 | startTime( 8 ), // an acceptable default | 81 | startTime( 8 ), // an acceptable default |
82 | syncing(FALSE), | 82 | syncing(FALSE), |
83 | inSearch(FALSE) | 83 | inSearch(FALSE) |
84 | { | 84 | { |
85 | QTime t; | 85 | QTime t; |
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() ); |
89 | loadSettings(); | 89 | loadSettings(); |
90 | setCaption( tr("Calendar") ); | 90 | setCaption( tr("Calendar") ); |
91 | setIcon( Resource::loadPixmap( "datebook_icon" ) ); | 91 | setIcon( Resource::loadPixmap( "datebook_icon" ) ); |
92 | 92 | ||
93 | setToolBarsMovable( FALSE ); | 93 | setToolBarsMovable( FALSE ); |
@@ -230,13 +230,13 @@ void DateBook::receive( const QCString &msg, const QByteArray &data ) | |||
230 | else if ( monthAction->isOn() ) | 230 | else if ( monthAction->isOn() ) |
231 | viewMonth(); | 231 | viewMonth(); |
232 | } | 232 | } |
233 | else if (msg == "editEvent(int)") { | 233 | else if (msg == "editEvent(int)") { |
234 | int uid; | 234 | int uid; |
235 | stream >> uid; | 235 | stream >> uid; |
236 | Event e=db->getEvent(uid); | 236 | Event e=db->eventByUID(uid); |
237 | editEvent(e); | 237 | editEvent(e); |
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ||
241 | DateBook::~DateBook() | 241 | DateBook::~DateBook() |
242 | { | 242 | { |
@@ -962,6 +962,27 @@ void DateBook::slotDoFind( const QString& txt, const QDate &dt, | |||
962 | nonrev.setStart( rev.start() ); | 962 | nonrev.setStart( rev.start() ); |
963 | } else | 963 | } else |
964 | emit signalNotFound(); | 964 | emit signalNotFound(); |
965 | wrapAround = !wrapAround; | 965 | wrapAround = !wrapAround; |
966 | } | 966 | } |
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 | |||