author | zautrix <zautrix> | 2005-04-18 10:41:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-18 10:41:31 (UTC) |
commit | 409e329447a7d00a93a56855fcddadbb0f793163 (patch) (unidiff) | |
tree | 1c92498d2dfb4c89358c64a6944aca1300a27d11 /korganizer/kotodoeditor.cpp | |
parent | 0ff0dca7ccb94ebb1381351e4e4081fe0bac500a (diff) | |
download | kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.zip kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.tar.gz kdepimpi-409e329447a7d00a93a56855fcddadbb0f793163.tar.bz2 |
morefixes
-rw-r--r-- | korganizer/kotodoeditor.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 6a05cc8..5513e8b 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp | |||
@@ -109,13 +109,13 @@ void KOTodoEditor::setupGeneral() | |||
109 | QFrame *topFrame = addPage(i18n("General")); | 109 | QFrame *topFrame = addPage(i18n("General")); |
110 | 110 | ||
111 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 111 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); |
112 | if ( QApplication::desktop()->width() < 480 ) { | 112 | if ( QApplication::desktop()->width() < 480 ) { |
113 | topLayout->setMargin(1); | 113 | topLayout->setMargin(marginHintSmall()); |
114 | topLayout->setSpacing(1); | 114 | topLayout->setSpacing(spacingHintSmall()); |
115 | } else { | 115 | } else { |
116 | topLayout->setMargin(marginHint()-1); | 116 | topLayout->setMargin(marginHint()); |
117 | topLayout->setSpacing(spacingHint()-1); | 117 | topLayout->setSpacing(spacingHint()); |
118 | } | 118 | } |
119 | mGeneral->initHeader(topFrame,topLayout); | 119 | mGeneral->initHeader(topFrame,topLayout); |
120 | mGeneral->initTime(topFrame,topLayout); | 120 | mGeneral->initTime(topFrame,topLayout); |
121 | mGeneral->initAlarm(topFrame,topLayout); | 121 | mGeneral->initAlarm(topFrame,topLayout); |
@@ -343,8 +343,12 @@ void KOTodoEditor::readTodo(Todo *todo) | |||
343 | } | 343 | } |
344 | 344 | ||
345 | void KOTodoEditor::writeTodo(Todo *event) | 345 | void KOTodoEditor::writeTodo(Todo *event) |
346 | { | 346 | { |
347 | bool maybeComputeRecurrenceTime = false; | ||
348 | if( event->hasRecurrenceID() && event->percentComplete() < 100) | ||
349 | maybeComputeRecurrenceTime = true; | ||
350 | event->setHasRecurrenceID( false ); | ||
347 | mGeneral->writeTodo(event); | 351 | mGeneral->writeTodo(event); |
348 | mDetails->writeEvent(event); | 352 | mDetails->writeEvent(event); |
349 | 353 | ||
350 | // set related event, i.e. parent to-do in this case. | 354 | // set related event, i.e. parent to-do in this case. |
@@ -353,9 +357,12 @@ void KOTodoEditor::writeTodo(Todo *event) | |||
353 | } | 357 | } |
354 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { | 358 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { |
355 | mRecurrence->writeEvent(event); | 359 | mRecurrence->writeEvent(event); |
356 | if ( event->doesRecur() ) { | 360 | if ( event->doesRecur() ) { |
357 | event->setRecurrenceID( event->dtStart().addSecs(-1) ); | 361 | int addSec = -1 ; |
362 | if ( maybeComputeRecurrenceTime && event->percentComplete() == 100 ) | ||
363 | addSec = 1; | ||
364 | event->setRecurrenceID( event->dtStart().addSecs( addSec ) ); | ||
358 | event->setRecurDates(); | 365 | event->setRecurDates(); |
359 | } else { | 366 | } else { |
360 | event->setHasRecurrenceID( false ); | 367 | event->setHasRecurrenceID( false ); |
361 | } | 368 | } |