summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index e0a1a21..1864e22 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1150,5 +1150,5 @@ void KOAgendaView::fillAgenda()
Todo *todo = todos.at(numTodo);
- if ( ! todo->hasDueDate() ) continue; // todo shall not be displayed if it has no date
+ if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date
// ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
@@ -1157,13 +1157,19 @@ void KOAgendaView::fillAgenda()
bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda;
- if ( ((todo->dtDue().date() == currentDate) && !overdue) ||
+ if ( ((todo->dtDue().date() == currentDate) && !overdue) || ( todo->hasCompletedDate() && todo->completed().date() == currentDate )||
((currentDate == today) && overdue) ) {
- if ( todo->doesFloat() || overdue ) { // Todo has no due-time set or is already overdue
+ if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue
if ( KOPrefs::instance()->mShowTodoInAgenda )
mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol);
}
else {
+ QDateTime dt;
+ if ( todo->hasCompletedDate() )
+ dt = todo->completed();
+ else
+ dt = todo->dtDue();;
+
- int endY = mAgenda->timeToY(todo->dtDue().time()) - 1;
+ int endY = mAgenda->timeToY(dt.time()) - 1;
int hi = (18/KOPrefs::instance()->mHourSize);
//qDebug("hei %d ",KOPrefs::instance()->mHourSize);