summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2005-06-03 23:10:45 (UTC)
committer zautrix <zautrix>2005-06-03 23:10:45 (UTC)
commit858b047efb5627824438cb3877e7bec0cebb3751 (patch) (unidiff)
tree7b36963344d4f5019f3a1ecb5eb9290f27c3b3c7 /libkcal
parent0207d193bdb6c66201562a17e68872e018ec223c (diff)
downloadkdepimpi-858b047efb5627824438cb3877e7bec0cebb3751.zip
kdepimpi-858b047efb5627824438cb3877e7bec0cebb3751.tar.gz
kdepimpi-858b047efb5627824438cb3877e7bec0cebb3751.tar.bz2
fixxx
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp6
-rw-r--r--libkcal/event.cpp6
-rw-r--r--libkcal/event.h2
-rw-r--r--libkcal/incidence.h2
-rw-r--r--libkcal/journal.cpp2
-rw-r--r--libkcal/journal.h2
-rw-r--r--libkcal/todo.cpp4
-rw-r--r--libkcal/todo.h2
8 files changed, 13 insertions, 13 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index e75df70..bc76c0b 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -303,13 +303,13 @@ void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted
303 // QString nextSum; 303 // QString nextSum;
304 //QDateTime nextEvent; 304 //QDateTime nextEvent;
305 if ( mNextAlarmIncidence == 0 || incidence == 0 ) { 305 if ( mNextAlarmIncidence == 0 || incidence == 0 ) {
306 computeNextAlarm = true; 306 computeNextAlarm = true;
307 } else { 307 } else {
308 if ( ! deleted ) { 308 if ( ! deleted ) {
309 nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ; 309 nextA = incidence->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ;
310 if ( ok ) { 310 if ( ok ) {
311 if ( nextA < mNextAlarmDateTime ) { 311 if ( nextA < mNextAlarmDateTime ) {
312 deRegisterAlarm(); 312 deRegisterAlarm();
313 mNextAlarmDateTime = nextA; 313 mNextAlarmDateTime = nextA;
314 mNextSummary = incidence->summary(); 314 mNextSummary = incidence->summary();
315 mNextAlarmEventDateTime = nextA.addSecs(offset ) ; 315 mNextAlarmEventDateTime = nextA.addSecs(offset ) ;
@@ -418,26 +418,26 @@ QDateTime CalendarLocal::nextAlarm( int daysTo )
418 Event *e; 418 Event *e;
419 bool ok; 419 bool ok;
420 bool found = false; 420 bool found = false;
421 int offset; 421 int offset;
422 mNextAlarmIncidence = 0; 422 mNextAlarmIncidence = 0;
423 for( e = mEventList.first(); e; e = mEventList.next() ) { 423 for( e = mEventList.first(); e; e = mEventList.next() ) {
424 next = e->getNextAlarmDateTime(& ok, &offset ) ; 424 next = e->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ;
425 if ( ok ) { 425 if ( ok ) {
426 if ( next < nextA ) { 426 if ( next < nextA ) {
427 nextA = next; 427 nextA = next;
428 found = true; 428 found = true;
429 mNextSummary = e->summary(); 429 mNextSummary = e->summary();
430 mNextAlarmEventDateTime = next.addSecs(offset ) ; 430 mNextAlarmEventDateTime = next.addSecs(offset ) ;
431 mNextAlarmIncidence = (Incidence *) e; 431 mNextAlarmIncidence = (Incidence *) e;
432 } 432 }
433 } 433 }
434 } 434 }
435 Todo *t; 435 Todo *t;
436 for( t = mTodoList.first(); t; t = mTodoList.next() ) { 436 for( t = mTodoList.first(); t; t = mTodoList.next() ) {
437 next = t->getNextAlarmDateTime(& ok, &offset ) ; 437 next = t->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ;
438 if ( ok ) { 438 if ( ok ) {
439 if ( next < nextA ) { 439 if ( next < nextA ) {
440 nextA = next; 440 nextA = next;
441 found = true; 441 found = true;
442 mNextSummary = t->summary(); 442 mNextSummary = t->summary();
443 mNextAlarmEventDateTime = next.addSecs(offset ); 443 mNextAlarmEventDateTime = next.addSecs(offset );
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index de8dceb..9b99855 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -168,17 +168,17 @@ Event::Transparency Event::transparency() const
168 168
169void Event::setDuration(int seconds) 169void Event::setDuration(int seconds)
170{ 170{
171 setHasEndDate(false); 171 setHasEndDate(false);
172 Incidence::setDuration(seconds); 172 Incidence::setDuration(seconds);
173} 173}
174QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const 174QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
175{ 175{
176 176
177 bool yes; 177 bool yes;
178 QDateTime incidenceStart = getNextOccurence( QDateTime::currentDateTime(), &yes ); 178 QDateTime incidenceStart = getNextOccurence( start_dt, &yes );
179 if ( ! yes || cancelled() ) { 179 if ( ! yes || cancelled() ) {
180 *ok = false; 180 *ok = false;
181 return QDateTime (); 181 return QDateTime ();
182 } 182 }
183 183
184 bool enabled = false; 184 bool enabled = false;
@@ -206,13 +206,13 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const
206 off = -secs; 206 off = -secs;
207 } 207 }
208 } 208 }
209 } 209 }
210 } 210 }
211 if ( enabled ) { 211 if ( enabled ) {
212 if ( alarmStart > QDateTime::currentDateTime() ) { 212 if ( alarmStart > start_dt ) {
213 *ok = true; 213 *ok = true;
214 * offset = off; 214 * offset = off;
215 return alarmStart; 215 return alarmStart;
216 } 216 }
217 } 217 }
218 *ok = false; 218 *ok = false;
diff --git a/libkcal/event.h b/libkcal/event.h
index 3bc8adc..8729956 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -39,13 +39,13 @@ class Event : public Incidence
39 Event(const Event &); 39 Event(const Event &);
40 ~Event(); 40 ~Event();
41 41
42 QCString type() const { return "Event"; } 42 QCString type() const { return "Event"; }
43 43
44 Incidence *clone(); 44 Incidence *clone();
45 QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const; 45 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
46 46
47 /** for setting an event's ending date/time with a QDateTime. */ 47 /** for setting an event's ending date/time with a QDateTime. */
48 void setDtEnd(const QDateTime &dtEnd); 48 void setDtEnd(const QDateTime &dtEnd);
49 /** Return the event's ending date/time as a QDateTime. */ 49 /** Return the event's ending date/time as a QDateTime. */
50 virtual QDateTime dtEnd() const; 50 virtual QDateTime dtEnd() const;
51 /** returns an event's end time as a string formatted according to the 51 /** returns an event's end time as a string formatted according to the
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index ebd50d0..aa51e84 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -111,13 +111,13 @@ class Incidence : public IncidenceBase
111 */ 111 */
112 virtual bool accept(Visitor &) { return false; } 112 virtual bool accept(Visitor &) { return false; }
113 113
114 virtual Incidence *clone() = 0; 114 virtual Incidence *clone() = 0;
115 virtual void cloneRelations( Incidence * ); 115 virtual void cloneRelations( Incidence * );
116 116
117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; 117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0;
118 void setReadOnly( bool ); 118 void setReadOnly( bool );
119 119
120 /** 120 /**
121 Recreate event. The event is made a new unique event, but already stored 121 Recreate event. The event is made a new unique event, but already stored
122 event information is preserved. Sets uniquie id, creation date, last 122 event information is preserved. Sets uniquie id, creation date, last
123 modification date and revision number. 123 modification date and revision number.
diff --git a/libkcal/journal.cpp b/libkcal/journal.cpp
index 351fb32..859161f 100644
--- a/libkcal/journal.cpp
+++ b/libkcal/journal.cpp
@@ -39,11 +39,11 @@ Incidence *Journal::clone()
39bool KCal::operator==( const Journal& j1, const Journal& j2 ) 39bool KCal::operator==( const Journal& j1, const Journal& j2 )
40{ 40{
41 return operator==( (const Incidence&)j1, (const Incidence&)j2 ); 41 return operator==( (const Incidence&)j1, (const Incidence&)j2 );
42} 42}
43 43
44 44
45QDateTime Journal::getNextAlarmDateTime( bool * ok, int * offset ) const 45QDateTime Journal::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
46{ 46{
47 *ok = false; 47 *ok = false;
48 return QDateTime (); 48 return QDateTime ();
49} 49}
diff --git a/libkcal/journal.h b/libkcal/journal.h
index cb90c7a..2c1d7ea 100644
--- a/libkcal/journal.h
+++ b/libkcal/journal.h
@@ -36,13 +36,13 @@ class Journal : public Incidence
36 Journal(); 36 Journal();
37 ~Journal(); 37 ~Journal();
38 38
39 QCString type() const { return "Journal"; } 39 QCString type() const { return "Journal"; }
40 40
41 Incidence *clone(); 41 Incidence *clone();
42 QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const; 42 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
43private: 43private:
44 bool accept(Visitor &v) { return v.visit(this); } 44 bool accept(Visitor &v) { return v.visit(this); }
45}; 45};
46 46
47 bool operator==( const Journal&, const Journal& ); 47 bool operator==( const Journal&, const Journal& );
48} 48}
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index d7431c7..473247a 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -512,13 +512,13 @@ void Todo::setPercentComplete(int v)
512 } 512 }
513 mPercentComplete = v; 513 mPercentComplete = v;
514 if ( v != 100 ) 514 if ( v != 100 )
515 mHasCompletedDate = false; 515 mHasCompletedDate = false;
516 updated(); 516 updated();
517} 517}
518QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const 518QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
519{ 519{
520 if ( isCompleted() || ! hasDueDate() || cancelled() ) { 520 if ( isCompleted() || ! hasDueDate() || cancelled() ) {
521 *ok = false; 521 *ok = false;
522 return QDateTime (); 522 return QDateTime ();
523 } 523 }
524 QDateTime incidenceStart; 524 QDateTime incidenceStart;
@@ -548,13 +548,13 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const
548 off = -secs; 548 off = -secs;
549 } 549 }
550 } 550 }
551 } 551 }
552 } 552 }
553 if ( enabled ) { 553 if ( enabled ) {
554 if ( alarmStart > QDateTime::currentDateTime() ) { 554 if ( alarmStart > start_dt ) {
555 *ok = true; 555 *ok = true;
556 * offset = off; 556 * offset = off;
557 return alarmStart; 557 return alarmStart;
558 } 558 }
559 } 559 }
560 *ok = false; 560 *ok = false;
diff --git a/libkcal/todo.h b/libkcal/todo.h
index a5354ce..ab8fdf1 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -41,13 +41,13 @@ namespace KCal {
41 ~Todo(); 41 ~Todo();
42 typedef ListBase<Todo> List; 42 typedef ListBase<Todo> List;
43 QCString type() const { return "Todo"; } 43 QCString type() const { return "Todo"; }
44 44
45 /** Return an exact copy of this todo. */ 45 /** Return an exact copy of this todo. */
46 Incidence *clone(); 46 Incidence *clone();
47 QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const; 47 QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const;
48 48
49 /** for setting the todo's due date/time with a QDateTime. */ 49 /** for setting the todo's due date/time with a QDateTime. */
50 void setDtDue(const QDateTime &dtDue); 50 void setDtDue(const QDateTime &dtDue);
51 /** returns an event's Due date/time as a QDateTime. */ 51 /** returns an event's Due date/time as a QDateTime. */
52 QDateTime dtDue() const; 52 QDateTime dtDue() const;
53 /** returns an event's due time as a string formatted according to the 53 /** returns an event's due time as a string formatted according to the