From 4a47a69978fd392be65ea67c5153d5e2ade74c19 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 01 Jul 2005 04:42:26 +0000 Subject: alarm fixx --- diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 5260051..4ada2d8 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -537,10 +537,24 @@ void Todo::setPercentComplete(int v) } QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const { - if ( isCompleted() || ! hasDueDate() || cancelled() || !alarmEnabled() ) { - *ok = false; + *ok = false; + if ( ! hasDueDate() || cancelled() || !alarmEnabled() ) { return QDateTime (); } + // if the recurring todo is set to complete and requested time < start time of todo + // we want to get the alarm. + bool iscompleted = isCompleted(); + if ( iscompleted && doesRecur() ) { + Todo * to = (Todo*) this; + to->checkSetCompletedFalse(); + iscompleted = isCompleted(); + if ( hasStartDate() && start_dt < dtStart() ){ + iscompleted = false; + } + } + if ( iscompleted ) { + return QDateTime (); + } QDateTime incidenceStart; incidenceStart = dtDue(); bool enabled = false; -- cgit v0.9.0.2