summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.cpp
authorzautrix <zautrix>2005-02-13 19:07:45 (UTC)
committer zautrix <zautrix>2005-02-13 19:07:45 (UTC)
commit7bd83e913399b8be68a7d37e8f02118ec9eab90e (patch) (side-by-side diff)
tree284d1592687ea4d3e0c220fafd289a702718dee4 /libkcal/incidence.cpp
parent293271fe9e6a9061da329183f8f488d79580f7da (diff)
downloadkdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.zip
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.gz
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.bz2
todo fixi
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 )
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;
}