summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp14
-rw-r--r--korganizer/koeventviewer.cpp5
-rw-r--r--korganizer/koeventviewerdialog.cpp1
3 files changed, 16 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
@@ -1149,22 +1149,28 @@ void KOAgendaView::fillAgenda()
for (numTodo = 0; numTodo < todos.count(); ++numTodo) {
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.
// Already completed items can be displayed on their original due date
//if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda
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);
int startY = endY -hi;
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 2f0fa9e..36a2947 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -379,8 +379,13 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
mText.append(i18n("<p><b>Priority:</b> %2</p>")
.arg(QString::number(event->priority())));
+ if ( event->percentComplete() == 100 && event->hasCompletedDate() ) {
+ mText.append(i18n("<p><i>Completed on %1</i></p>")
+ .arg( event->completedStr() ));
+ } else {
mText.append(i18n("<p><i>%1 % completed</i></p>")
.arg(event->percentComplete()));
+ }
formatReadOnly(event);
formatAttendees(event);
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 3979ed2..f6f7258 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -221,6 +221,7 @@ void KOEventViewerDialog::showIncidence()
}
*/
((Todo*)mIncidence)->setCompleted( true );
+ ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() );
hide();
emit todoCompleted(((Todo*)mIncidence));
return;