author | hakan <hakan> | 2002-03-31 12:56:14 (UTC) |
---|---|---|
committer | hakan <hakan> | 2002-03-31 12:56:14 (UTC) |
commit | 7208583b0b7ff339e6019b188332d8bcb8f30973 (patch) (unidiff) | |
tree | 4d0b064f1aa0a8553703af4f6e481393cf0ee13c /library | |
parent | a386e428cbd6b468d4dbff5bf2df4fdba6df9b6e (diff) | |
download | opie-7208583b0b7ff339e6019b188332d8bcb8f30973.zip opie-7208583b0b7ff339e6019b188332d8bcb8f30973.tar.gz opie-7208583b0b7ff339e6019b188332d8bcb8f30973.tar.bz2 |
Moved getEvent(uid) into some hack DateBookDBHack::eventByUID(uid) in the datbeook that might work as long as the QDate implementation are not chnaged.
-rw-r--r-- | library/datebookdb.cpp | 14 | ||||
-rw-r--r-- | library/datebookdb.h | 1 |
2 files changed, 0 insertions, 15 deletions
diff --git a/library/datebookdb.cpp b/library/datebookdb.cpp index da5a797..2ac9a0c 100644 --- a/library/datebookdb.cpp +++ b/library/datebookdb.cpp | |||
@@ -578,38 +578,24 @@ QValueList<EffectiveEvent> DateBookDB::getEffectiveEvents( const QDateTime &dt) | |||
578 | QValueList<EffectiveEvent> tmpList; | 578 | QValueList<EffectiveEvent> tmpList; |
579 | QDateTime dtTmp; | 579 | QDateTime dtTmp; |
580 | 580 | ||
581 | for (it = day.begin(); it != day.end(); ++it ) { | 581 | for (it = day.begin(); it != day.end(); ++it ) { |
582 | dtTmp = QDateTime( (*it).date(), (*it).start() ); | 582 | dtTmp = QDateTime( (*it).date(), (*it).start() ); |
583 | // at the moment we don't have second granularity, be nice about that.. | 583 | // at the moment we don't have second granularity, be nice about that.. |
584 | if ( QABS(dt.secsTo(dtTmp)) < 60 ) | 584 | if ( QABS(dt.secsTo(dtTmp)) < 60 ) |
585 | tmpList.append( *it ); | 585 | tmpList.append( *it ); |
586 | } | 586 | } |
587 | return tmpList; | 587 | return tmpList; |
588 | } | 588 | } |
589 | 589 | ||
590 | Event DateBookDB::getEvent( int uid ) { | ||
591 | QValueList<Event>::ConstIterator it; | ||
592 | |||
593 | for (it = eventList.begin(); it != eventList.end(); it++) { | ||
594 | if ((*it).uid() == uid) return *it; | ||
595 | } | ||
596 | for (it = repeatEvents.begin(); it != repeatEvents.end(); it++) { | ||
597 | if ((*it).uid() == uid) return *it; | ||
598 | } | ||
599 | |||
600 | qDebug("Event not found: uid=%d\n", uid); | ||
601 | } | ||
602 | |||
603 | |||
604 | void DateBookDB::addEvent( const Event &ev, bool doalarm ) | 590 | void DateBookDB::addEvent( const Event &ev, bool doalarm ) |
605 | { | 591 | { |
606 | // write to the journal... | 592 | // write to the journal... |
607 | saveJournalEntry( ev, ACTION_ADD, -1, false ); | 593 | saveJournalEntry( ev, ACTION_ADD, -1, false ); |
608 | addJFEvent( ev, doalarm ); | 594 | addJFEvent( ev, doalarm ); |
609 | d->clean = false; | 595 | d->clean = false; |
610 | } | 596 | } |
611 | 597 | ||
612 | void DateBookDB::addJFEvent( const Event &ev, bool doalarm ) | 598 | void DateBookDB::addJFEvent( const Event &ev, bool doalarm ) |
613 | { | 599 | { |
614 | if ( doalarm && ev.hasAlarm() ) | 600 | if ( doalarm && ev.hasAlarm() ) |
615 | addEventAlarm( ev ); | 601 | addEventAlarm( ev ); |
diff --git a/library/datebookdb.h b/library/datebookdb.h index e4c251c..0add028 100644 --- a/library/datebookdb.h +++ b/library/datebookdb.h | |||
@@ -35,25 +35,24 @@ class DateBookDB | |||
35 | public: | 35 | public: |
36 | DateBookDB(); | 36 | DateBookDB(); |
37 | ~DateBookDB(); | 37 | ~DateBookDB(); |
38 | 38 | ||
39 | // very depreciated now!!! | 39 | // very depreciated now!!! |
40 | QValueList<Event> getEvents( const QDate &from, const QDate &to ); | 40 | QValueList<Event> getEvents( const QDate &from, const QDate &to ); |
41 | QValueList<Event> getEvents( const QDateTime &start ); | 41 | QValueList<Event> getEvents( const QDateTime &start ); |
42 | 42 | ||
43 | // USE THESE!!! | 43 | // USE THESE!!! |
44 | QValueList<EffectiveEvent> getEffectiveEvents( const QDate &from, | 44 | QValueList<EffectiveEvent> getEffectiveEvents( const QDate &from, |
45 | const QDate &to ); | 45 | const QDate &to ); |
46 | QValueList<EffectiveEvent> getEffectiveEvents( const QDateTime &start ); | 46 | QValueList<EffectiveEvent> getEffectiveEvents( const QDateTime &start ); |
47 | Event getEvent( int uid ); | ||
48 | 47 | ||
49 | QValueList<Event> getRawRepeats() const; | 48 | QValueList<Event> getRawRepeats() const; |
50 | QValueList<Event> getNonRepeatingEvents( const QDate &from, | 49 | QValueList<Event> getNonRepeatingEvents( const QDate &from, |
51 | const QDate &to ) const; | 50 | const QDate &to ) const; |
52 | 51 | ||
53 | // Use these when dealing with adding removing events... | 52 | // Use these when dealing with adding removing events... |
54 | void addEvent( const Event &ev, bool doalarm=TRUE ); | 53 | void addEvent( const Event &ev, bool doalarm=TRUE ); |
55 | void removeEvent( const Event &ev ); | 54 | void removeEvent( const Event &ev ); |
56 | void editEvent( const Event &old, Event &ev ); | 55 | void editEvent( const Event &old, Event &ev ); |
57 | // add/remove event without journaling ( these ended up in public by accident, never | 56 | // add/remove event without journaling ( these ended up in public by accident, never |
58 | // use them unless you know what you are doing...), | 57 | // use them unless you know what you are doing...), |
59 | // please put them in private if we ever can change the class... | 58 | // please put them in private if we ever can change the class... |