-rw-r--r-- | libkcal/kincidenceformatter.cpp | 18 | ||||
-rw-r--r-- | libkcal/todo.cpp | 5 | ||||
-rw-r--r-- | libkcal/todo.h | 2 |
3 files changed, 13 insertions, 12 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index c52f2b3..6d07d4c 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -169,2 +169,10 @@ void KIncidenceFormatter::setTodo(Todo *event ) } + if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { + mText +="<font color=\"#B00000\">"; + addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(shortDate) ) ); + mText += "</font>"; + } else { + mText.append(i18n("<p><i>%1 % completed</i></p>") + .arg(event->percentComplete())); + } if (event->cancelled ()) { @@ -186,11 +194,3 @@ void KIncidenceFormatter::setTodo(Todo *event ) - 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())); - } - - addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); + addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); formatCategories(event); diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 7362bdf..7d04793 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -302,5 +302,5 @@ QDateTime Todo::completed() const -QString Todo::completedStr() const +QString Todo::completedStr( bool shortF ) const { - return KGlobal::locale()->formatDateTime(mCompleted); + return KGlobal::locale()->formatDateTime(mCompleted, shortF); } @@ -309,2 +309,3 @@ void Todo::setCompleted(const QDateTime &completed) { + qDebug("Todo::setCompleted "); mHasCompletedDate = true; diff --git a/libkcal/todo.h b/libkcal/todo.h index 0f22c59..41f5841 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h @@ -95,3 +95,3 @@ class Todo : public Incidence QDateTime completed() const; - QString completedStr() const; + QString completedStr(bool shortF = true) const; /** set date and time of completion */ |