summaryrefslogtreecommitdiffabout
path: root/libkcal/event.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/event.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/event.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index de8dceb..9b99855 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -162,29 +162,29 @@ void Event::setTransparency(Event::Transparency transparency)
}
Event::Transparency Event::transparency() const
{
return mTransparency;
}
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 ();
}
bool enabled = false;
Alarm* alarm;
int off = 0;
QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
// if ( QDateTime::currentDateTime() > incidenceStart ){
// *ok = false;
// return incidenceStart;
@@ -200,22 +200,22 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const
} else {
int secs = alarm->startOffset().asSeconds();
if ( incidenceStart.addSecs( secs ) < alarmStart ) {
alarmStart = incidenceStart.addSecs( secs );
enabled = true;
off = -secs;
}
}
}
}
if ( enabled ) {
- if ( alarmStart > QDateTime::currentDateTime() ) {
+ if ( alarmStart > start_dt ) {
*ok = true;
* offset = off;
return alarmStart;
}
}
*ok = false;
return QDateTime ();
}