-rw-r--r-- | korganizer/koagenda.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 002234d..7c41cab 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -1419,5 +1419,5 @@ KOAgendaItem * KOAgenda::getItemForTodo ( Todo * todo ) void KOAgenda::updateTodo( Todo * todo, int days, bool remove) { - + // ( todo->hasCompletedDate() && todo->completed().date() == currentDate )|| KOAgendaItem *item; item = getItemForTodo ( todo ); @@ -1458,4 +1458,9 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) bool overdue = (!todo->isCompleted()) && (todo->dtDue() < QDate::currentDate())&& ( KOPrefs::instance()->mShowTodoInAgenda ); QDate currentDate; + QDateTime dt; + if ( todo->hasCompletedDate() ) + dt = todo->completed(); + else + dt = todo->dtDue(); if ( overdue ) { currentDate = QDate::currentDate(); @@ -1463,5 +1468,5 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) } else - currentDate = todo->dtDue().date(); + currentDate = dt.date(); if ( todo->doesFloat() || overdue ) { @@ -1477,5 +1482,5 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove) // mAgenda globalFlagBlockAgendaItemPaint = 1; - int endY = timeToY(todo->dtDue().time()) - 1; + int endY = timeToY(dt.time()) - 1; int hi = 12/KOPrefs::instance()->mHourSize; int startY = endY - 1-hi; |