author | zautrix <zautrix> | 2005-02-13 19:07:45 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-13 19:07:45 (UTC) |
commit | 7bd83e913399b8be68a7d37e8f02118ec9eab90e (patch) (side-by-side diff) | |
tree | 284d1592687ea4d3e0c220fafd289a702718dee4 /korganizer/calendarview.cpp | |
parent | 293271fe9e6a9061da329183f8f488d79580f7da (diff) | |
download | kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.zip kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.gz kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.bz2 |
todo fixi
-rw-r--r-- | korganizer/calendarview.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 7c8316f..3dac20b 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2263,6 +2263,9 @@ void CalendarView::slotSelectPickerDate( QDate d) if ( mMoveIncidence->type() == "Todo" ) { Todo * to = (Todo *) mMoveIncidence; QTime tim; + int len = 0; + if ( to->hasStartDate() && to->hasDueDate() ) + len = to->dtStart().secsTo( to->dtDue()); if ( to->hasDueDate() ) tim = to->dtDue().time(); else { @@ -2272,6 +2275,15 @@ void CalendarView::slotSelectPickerDate( QDate d) } QDateTime dt ( d,tim ); to->setDtDue( dt ); + + if ( to->hasStartDate() ) { + if ( len>0 ) + to->setDtStart(to->dtDue().addSecs( -len )); + else + if (to->dtStart() > to->dtDue() ) + to->setDtStart(to->dtDue().addDays( -3 )); + } + todoChanged( to ); } else { if ( mMoveIncidence->doesRecur() ) { @@ -3810,7 +3822,7 @@ bool CalendarView::removeCompletedSubTodos( Todo* t ) deleteTodo = false; } if ( deleteTodo ) { - if ( t->isCompleted() ) { + if ( t->isCompleted() && !t->doesRecur()) { checkExternalId( t ); mCalendar->deleteTodo( t ); changeTodoDisplay( t,KOGlobals::EVENTDELETED ); |