summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
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
if ( mNextAlarmIncidence == 0 || incidence == 0 ) {
computeNextAlarm = true;
} else {
if ( ! deleted ) {
- nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ;
+ nextA = incidence->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ;
if ( ok ) {
if ( nextA < mNextAlarmDateTime ) {
deRegisterAlarm();
mNextAlarmDateTime = nextA;
@@ -420,9 +420,9 @@ QDateTime CalendarLocal::nextAlarm( int daysTo )
bool found = false;
int offset;
mNextAlarmIncidence = 0;
for( e = mEventList.first(); e; e = mEventList.next() ) {
- next = e->getNextAlarmDateTime(& ok, &offset ) ;
+ next = e->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ;
if ( ok ) {
if ( next < nextA ) {
nextA = next;
found = true;
@@ -433,9 +433,9 @@ QDateTime CalendarLocal::nextAlarm( int daysTo )
}
}
Todo *t;
for( t = mTodoList.first(); t; t = mTodoList.next() ) {
- next = t->getNextAlarmDateTime(& ok, &offset ) ;
+ next = t->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ;
if ( ok ) {
if ( next < nextA ) {
nextA = next;
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)
{
setHasEndDate(false);
Incidence::setDuration(seconds);
}
-QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const
+QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
{
bool yes;
- QDateTime incidenceStart = getNextOccurence( QDateTime::currentDateTime(), &yes );
+ QDateTime incidenceStart = getNextOccurence( start_dt, &yes );
if ( ! yes || cancelled() ) {
*ok = false;
return QDateTime ();
}
@@ -208,9 +208,9 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const
}
}
}
if ( enabled ) {
- if ( alarmStart > QDateTime::currentDateTime() ) {
+ if ( alarmStart > start_dt ) {
*ok = true;
* offset = off;
return alarmStart;
}
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
QCString type() const { return "Event"; }
Incidence *clone();
- QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const;
+ QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
/** for setting an event's ending date/time with a QDateTime. */
void setDtEnd(const QDateTime &dtEnd);
/** 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
virtual Incidence *clone() = 0;
virtual void cloneRelations( Incidence * );
- virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0;
+ virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0;
void setReadOnly( bool );
/**
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 )
return operator==( (const Incidence&)j1, (const Incidence&)j2 );
}
-QDateTime Journal::getNextAlarmDateTime( bool * ok, int * offset ) const
+QDateTime Journal::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
{
*ok = false;
return QDateTime ();
}
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
QCString type() const { return "Journal"; }
Incidence *clone();
- QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const;
+ QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
private:
bool accept(Visitor &v) { return v.visit(this); }
};
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)
if ( v != 100 )
mHasCompletedDate = false;
updated();
}
-QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const
+QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
{
if ( isCompleted() || ! hasDueDate() || cancelled() ) {
*ok = false;
return QDateTime ();
@@ -550,9 +550,9 @@ QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const
}
}
}
if ( enabled ) {
- if ( alarmStart > QDateTime::currentDateTime() ) {
+ if ( alarmStart > start_dt ) {
*ok = true;
* offset = off;
return alarmStart;
}
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 {
QCString type() const { return "Todo"; }
/** Return an exact copy of this todo. */
Incidence *clone();
- QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const;
+ QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const;
/** for setting the todo's due date/time with a QDateTime. */
void setDtDue(const QDateTime &dtDue);
/** returns an event's Due date/time as a QDateTime. */