-rw-r--r-- | libkcal/incidence.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 0684af2..708ee6b 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -213,10 +213,18 @@ Incidence* Incidence::recreateCloneException( QDate d ) if ( doesRecur() ) { addExDate( d ); newInc->recurrence()->unsetRecurs(); + if ( type() == "Event") { int len = dtStart().secsTo( ((Event*)this)->dtEnd()); QTime tim = dtStart().time(); newInc->setDtStart( QDateTime(d, tim) ); ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); + } else { + int len = dtStart().secsTo( ((Todo*)this)->dtDue()); + QTime tim = ((Todo*)this)->dtDue().time(); + ((Todo*)newInc)->setDtDue( QDateTime(d, tim) ); + ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) ); + ((Todo*)this)->setRecurDates(); + } } return newInc; } |