summaryrefslogtreecommitdiffabout
path: root/libkcal/kincidenceformatter.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/kincidenceformatter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp46
1 files changed, 34 insertions, 12 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index cc3088a..1751ae3 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -9,15 +9,18 @@
KIncidenceFormatter* KIncidenceFormatter::mInstance = 0;
static KStaticDeleter<KIncidenceFormatter> insd;
-QString KIncidenceFormatter::getFormattedText( Incidence * inc )
+QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified )
{
// #ifndef QT_NO_INPUTDIALOG
// return QInputDialog::getItem( caption, label, items, current, editable );
// #else
// return QString::null;
// #endif
+ mDetails = details;
+ mCreated = created ;
+ mModified = modified;
mText = "";
if ( inc->type() == "Event" )
setEvent((Event *) inc );
else if ( inc->type() == "Todo" )
@@ -137,17 +140,28 @@ void KIncidenceFormatter::setEvent(Event *event)
addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
// mText.append(event->secrecyStr()+"<br>");
formatCategories(event);
- if (!event->description().isEmpty()) {
- addTag("p",i18n("<b>Details: </b>"));
- addTag("p",event->description());
+ if ( mDetails ) {
+ if (!event->description().isEmpty()) {
+ addTag("p",i18n("<b>Details: </b>"));
+ addTag("p",event->description());
+ }
}
-
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 ));
+
+ }
}
void KIncidenceFormatter::setTodo(Todo *event )
@@ -211,18 +225,26 @@ void KIncidenceFormatter::setTodo(Todo *event )
.arg(QString::number(event->priority())));
addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() );
formatCategories(event);
- if (!event->description().isEmpty()) {
- addTag("p",i18n("<b>Details: </b>"));
- addTag("p",event->description());
+ if ( mDetails ) {
+ if (!event->description().isEmpty()) {
+ addTag("p",i18n("<b>Details: </b>"));
+ addTag("p",event->description());
+ }
}
-
-
-
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 ));
+
+ }
}
void KIncidenceFormatter::setJournal(Journal* )
{