From 7bd83e913399b8be68a7d37e8f02118ec9eab90e Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 13 Feb 2005 19:07:45 +0000 Subject: todo fixi --- (limited to 'libkcal/incidence.cpp') 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(); - int len = dtStart().secsTo( ((Event*)this)->dtEnd()); - QTime tim = dtStart().time(); - newInc->setDtStart( QDateTime(d, tim) ); - ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); + 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; } -- cgit v0.9.0.2