summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp18
-rw-r--r--libkcal/todo.cpp5
-rw-r--r--libkcal/todo.h2
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
@@ -168,4 +168,12 @@ void KIncidenceFormatter::setTodo(Todo *event )
mText += "</font>";
}
+ 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 ()) {
mText +="<font color=\"#B00000\">";
@@ -185,13 +193,5 @@ void KIncidenceFormatter::setTodo(Todo *event )
.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()));
- }
-
- addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
+ addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
formatCategories(event);
if (!event->description().isEmpty()) {
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 7362bdf..7d04793 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -301,11 +301,12 @@ 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);
}
void Todo::setCompleted(const QDateTime &completed)
{
+ qDebug("Todo::setCompleted ");
mHasCompletedDate = true;
mPercentComplete = 100;
diff --git a/libkcal/todo.h b/libkcal/todo.h
index 0f22c59..41f5841 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -94,5 +94,5 @@ class Todo : public Incidence
/** return date and time when todo was completed */
QDateTime completed() const;
- QString completedStr() const;
+ QString completedStr(bool shortF = true) const;
/** set date and time of completion */
void setCompleted(const QDateTime &completed);