summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp46
-rw-r--r--libkcal/kincidenceformatter.h3
2 files changed, 36 insertions, 13 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;
12 12
13QString KIncidenceFormatter::getFormattedText( Incidence * inc ) 13QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified )
14{ 14{
@@ -19,2 +19,5 @@ QString KIncidenceFormatter::getFormattedText( Incidence * inc )
19// #endif 19// #endif
20 mDetails = details;
21 mCreated = created ;
22 mModified = modified;
20 mText = ""; 23 mText = "";
@@ -140,8 +143,9 @@ void KIncidenceFormatter::setEvent(Event *event)
140 formatCategories(event); 143 formatCategories(event);
141 if (!event->description().isEmpty()) { 144 if ( mDetails ) {
142 addTag("p",i18n("<b>Details: </b>")); 145 if (!event->description().isEmpty()) {
143 addTag("p",event->description()); 146 addTag("p",i18n("<b>Details: </b>"));
147 addTag("p",event->description());
148 }
144 } 149 }
145 150
146
147 formatReadOnly(event); 151 formatReadOnly(event);
@@ -149,2 +153,12 @@ void KIncidenceFormatter::setEvent(Event *event)
149 153
154 if ( mCreated ) {
155 addTag("p",i18n("<b>Created: ") +" </b>");
156 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
157
158 }
159 if ( mModified ) {
160 addTag("p",i18n("<b>Last modified: ") +" </b>");
161 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
162
163 }
150 164
@@ -214,12 +228,20 @@ void KIncidenceFormatter::setTodo(Todo *event )
214 formatCategories(event); 228 formatCategories(event);
215 if (!event->description().isEmpty()) { 229 if ( mDetails ) {
216 addTag("p",i18n("<b>Details: </b>")); 230 if (!event->description().isEmpty()) {
217 addTag("p",event->description()); 231 addTag("p",i18n("<b>Details: </b>"));
232 addTag("p",event->description());
233 }
218 } 234 }
219
220
221
222 formatReadOnly(event); 235 formatReadOnly(event);
223 formatAttendees(event); 236 formatAttendees(event);
224 237 if ( mCreated ) {
238 addTag("p",i18n("<b>Created: ") +" </b>");
239 addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate ));
240
241 }
242 if ( mModified ) {
243 addTag("p",i18n("<b>Last modified: ") +" </b>");
244 addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ));
245
246 }
225} 247}
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
19 ~KIncidenceFormatter(); 19 ~KIncidenceFormatter();
20 QString getFormattedText( Incidence * inc ); 20 QString getFormattedText( Incidence * inc , bool details = false, bool created = false, bool modified = false );
21 21
@@ -35,2 +35,3 @@ class KIncidenceFormatter : public QObject
35 bool mSyncMode; 35 bool mSyncMode;
36 bool mDetails, mCreated ,mModified;
36 37