summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneraltodo.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeditorgeneraltodo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneraltodo.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index 158a7d3..b9a028b 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -196,7 +196,12 @@ void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay)
enableTimeEdits( !allDay );
-
- mDueCheck->setChecked(false);
- enableDueEdit(false);
+ if ( due.isValid() ) {
+ mDueCheck->setChecked(true);
+ enableDueEdit(true);
+ } else {
+ mDueCheck->setChecked(false);
+ enableDueEdit(false);
+ due = QDateTime::currentDateTime().addDays(7);
+ }
alarmDisable(true);
@@ -207,7 +212,7 @@ void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay)
mDueDateEdit->setDate(due.date());
mDueTimeEdit->setTime(due.time());
-
- mStartDateEdit->setDate(QDate::currentDate());
- mStartTimeEdit->setTime(QTime::currentTime());
+ due = due.addDays(-7);
+ mStartDateEdit->setDate(due.date());
+ mStartTimeEdit->setTime(due.time());
mPriorityCombo->setCurrentItem(2);