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
@@ -167,6 +167,14 @@ void KIncidenceFormatter::setTodo(Todo *event )
if ( mColorMode )
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\">";
addTag("i",i18n("This todo has been cancelled!"));
@@ -184,15 +192,7 @@ void KIncidenceFormatter::setTodo(Todo *event )
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()));
- }
-
- addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
+ addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
formatCategories(event);
if (!event->description().isEmpty()) {
addTag("p",i18n("<b>Details: </b>"));
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 7362bdf..7d04793 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -300,13 +300,14 @@ QDateTime Todo::completed() const
return mCompleted;
}
-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;
mCompleted = getEvenTime(completed);
diff --git a/libkcal/todo.h b/libkcal/todo.h
index 0f22c59..41f5841 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -93,7 +93,7 @@ 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);