summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.cpp
Unidiff
Diffstat (limited to 'libkcal/incidence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp16
1 files changed, 12 insertions, 4 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 )
213 if ( doesRecur() ) { 213 if ( doesRecur() ) {
214 addExDate( d ); 214 addExDate( d );
215 newInc->recurrence()->unsetRecurs(); 215 newInc->recurrence()->unsetRecurs();
216 int len = dtStart().secsTo( ((Event*)this)->dtEnd()); 216 if ( type() == "Event") {
217 QTime tim = dtStart().time(); 217 int len = dtStart().secsTo( ((Event*)this)->dtEnd());
218 newInc->setDtStart( QDateTime(d, tim) ); 218 QTime tim = dtStart().time();
219 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); 219 newInc->setDtStart( QDateTime(d, tim) );
220 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
221 } else {
222 int len = dtStart().secsTo( ((Todo*)this)->dtDue());
223 QTime tim = ((Todo*)this)->dtDue().time();
224 ((Todo*)newInc)->setDtDue( QDateTime(d, tim) );
225 ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) );
226 ((Todo*)this)->setRecurDates();
227 }
220 } 228 }
221 return newInc; 229 return newInc;
222} 230}