-rw-r--r-- | korganizer/kotodoeditor.cpp | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index f9f037a..51e2524 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp @@ -352,35 +352,16 @@ void KOTodoEditor::writeTodo(Todo *event) } if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { mRecurrence->writeEvent(event); - event->setRecurrenceID( event->dtStart().addSecs(-1) ); - event->setRecurDates(); -#if 0 - bool ok; - QDateTime next = event->getNextOccurence( event->dtStart().addSecs(-1), &ok ); - if ( ok ) { - QDateTime from,to; - bool time = mGeneral->mTimeButton->isChecked(); - if ( time ) { - to = QDateTime( mGeneral->mDueDateEdit->date(), mGeneral->mDueTimeEdit->getTime() ) ; - from = QDateTime( mGeneral->mStartDateEdit->date(),mGeneral->mStartTimeEdit->getTime( )) ; - } else { - to = QDateTime( mGeneral->mDueDateEdit->date(), QTime( 0,0,0) ) ; - from = QDateTime( mGeneral->mStartDateEdit->date(),QTime( 0,0,0) ) ; - } - if ( to < from ) - to = from; - int secs = from.secsTo( to ); - event->setRecurrenceID( next ); - event->setDtStart( next ); - event->setDtDue( next.addSecs( secs ) ); - } - else { + if ( event->doesRecur() ) { + event->setRecurrenceID( event->dtStart().addSecs(-1) ); + event->setRecurDates(); + } else { event->setHasRecurrenceID( false ); - event->recurrence()->unsetRecurs(); } -#endif - } else - event->recurrence()->unsetRecurs(); + } else { + event->setHasRecurrenceID( false ); + event->recurrence()->unsetRecurs(); + } } bool KOTodoEditor::validateInput() |