summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
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
@@ -305,9 +305,9 @@ void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted
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;
@@ -420,9 +420,9 @@ QDateTime CalendarLocal::nextAlarm( int daysTo )
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;
@@ -433,9 +433,9 @@ QDateTime CalendarLocal::nextAlarm( int daysTo )
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;
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index de8dceb..9b99855 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -170,13 +170,13 @@ void 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 }
@@ -208,9 +208,9 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const
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 }
diff --git a/libkcal/event.h b/libkcal/event.h
index 3bc8adc..8729956 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -41,9 +41,9 @@ class Event : public Incidence
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. */
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index ebd50d0..aa51e84 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -113,9 +113,9 @@ class Incidence : public IncidenceBase
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
diff --git a/libkcal/journal.cpp b/libkcal/journal.cpp
index 351fb32..859161f 100644
--- a/libkcal/journal.cpp
+++ b/libkcal/journal.cpp
@@ -41,9 +41,9 @@ bool KCal::operator==( const Journal& j1, const Journal& j2 )
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
@@ -38,9 +38,9 @@ class Journal : public Incidence
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
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index d7431c7..473247a 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -514,9 +514,9 @@ void Todo::setPercentComplete(int 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 ();
@@ -550,9 +550,9 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const
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 }
diff --git a/libkcal/todo.h b/libkcal/todo.h
index a5354ce..ab8fdf1 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -43,9 +43,9 @@ namespace KCal {
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. */