summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp14
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
@@ -2264,4 +2264,7 @@ void CalendarView::slotSelectPickerDate( QDate d)
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();
@@ -2273,4 +2276,13 @@ 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 {
@@ -3811,5 +3823,5 @@ bool CalendarView::removeCompletedSubTodos( Todo* t )
}
if ( deleteTodo ) {
- if ( t->isCompleted() ) {
+ if ( t->isCompleted() && !t->doesRecur()) {
checkExternalId( t );
mCalendar->deleteTodo( t );