summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
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)
2264 Todo * to = (Todo *) mMoveIncidence; 2264 Todo * to = (Todo *) mMoveIncidence;
2265 QTime tim; 2265 QTime tim;
2266 int len = 0;
2267 if ( to->hasStartDate() && to->hasDueDate() )
2268 len = to->dtStart().secsTo( to->dtDue());
2266 if ( to->hasDueDate() ) 2269 if ( to->hasDueDate() )
2267 tim = to->dtDue().time(); 2270 tim = to->dtDue().time();
@@ -2273,4 +2276,13 @@ void CalendarView::slotSelectPickerDate( QDate d)
2273 QDateTime dt ( d,tim ); 2276 QDateTime dt ( d,tim );
2274 to->setDtDue( dt ); 2277 to->setDtDue( dt );
2278
2279 if ( to->hasStartDate() ) {
2280 if ( len>0 )
2281 to->setDtStart(to->dtDue().addSecs( -len ));
2282 else
2283 if (to->dtStart() > to->dtDue() )
2284 to->setDtStart(to->dtDue().addDays( -3 ));
2285 }
2286
2275 todoChanged( to ); 2287 todoChanged( to );
2276 } else { 2288 } else {
@@ -3811,5 +3823,5 @@ bool CalendarView::removeCompletedSubTodos( Todo* t )
3811 } 3823 }
3812 if ( deleteTodo ) { 3824 if ( deleteTodo ) {
3813 if ( t->isCompleted() ) { 3825 if ( t->isCompleted() && !t->doesRecur()) {
3814 checkExternalId( t ); 3826 checkExternalId( t );
3815 mCalendar->deleteTodo( t ); 3827 mCalendar->deleteTodo( t );