summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp32
-rw-r--r--libkcal/kincidenceformatter.h3
2 files changed, 29 insertions, 6 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index cc3088a..1751ae3 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -12,3 +12,3 @@ static KStaticDeleter<KIncidenceFormatter> insd;
-QString KIncidenceFormatter::getFormattedText( Incidence * inc )
+QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified )
{
@@ -19,2 +19,5 @@ QString KIncidenceFormatter::getFormattedText( Incidence * inc )
// #endif
+ mDetails = details;
+ mCreated = created ;
+ mModified = modified;
mText = "";
@@ -140,2 +143,3 @@ void KIncidenceFormatter::setEvent(Event *event)
formatCategories(event);
+ if ( mDetails ) {
if (!event->description().isEmpty()) {
@@ -144,3 +148,3 @@ void KIncidenceFormatter::setEvent(Event *event)
}
-
+ }
@@ -149,2 +153,12 @@ void KIncidenceFormatter::setEvent(Event *event)
+ if ( mCreated ) {
+ addTag("p",i18n("<b>Created: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
+
+ }
+ if ( mModified ) {
+ addTag("p",i18n("<b>Last modified: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
+
+ }
@@ -214,2 +228,3 @@ void KIncidenceFormatter::setTodo(Todo *event )
formatCategories(event);
+ if ( mDetails ) {
if (!event->description().isEmpty()) {
@@ -218,9 +233,16 @@ void KIncidenceFormatter::setTodo(Todo *event )
}
-
-
-
+ }
formatReadOnly(event);
formatAttendees(event);
+ if ( mCreated ) {
+ addTag("p",i18n("<b>Created: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
}
+ if ( mModified ) {
+ addTag("p",i18n("<b>Last modified: ") +" </b>");
+ addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
+
+ }
+}
diff --git a/libkcal/kincidenceformatter.h b/libkcal/kincidenceformatter.h
index 6165a9f..068e6d2 100644
--- a/libkcal/kincidenceformatter.h
+++ b/libkcal/kincidenceformatter.h
@@ -19,3 +19,3 @@ class KIncidenceFormatter : public QObject
~KIncidenceFormatter();
- QString getFormattedText( Incidence * inc );
+ QString getFormattedText( Incidence * inc , bool details = false, bool created = false, bool modified = false );
@@ -35,2 +35,3 @@ class KIncidenceFormatter : public QObject
bool mSyncMode;
+ bool mDetails, mCreated ,mModified;