From 8e8d2bd0c31eb272a7f26756252ff4930d0602bc Mon Sep 17 00:00:00 2001 From: zautrix Date: Thu, 17 Feb 2005 21:31:18 +0000 Subject: fixes --- (limited to 'libkcal') diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index cc3088a..1751ae3 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp @@ -10,13 +10,16 @@ KIncidenceFormatter* KIncidenceFormatter::mInstance = 0; static KStaticDeleter 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 ); @@ -138,15 +141,26 @@ void KIncidenceFormatter::setEvent(Event *event) addTag("p",i18n("Access: ") +event->secrecyStr() ); // mText.append(event->secrecyStr()+"
"); formatCategories(event); - if (!event->description().isEmpty()) { - addTag("p",i18n("Details: ")); - addTag("p",event->description()); + if ( mDetails ) { + if (!event->description().isEmpty()) { + addTag("p",i18n("Details: ")); + addTag("p",event->description()); + } } - formatReadOnly(event); formatAttendees(event); + if ( mCreated ) { + addTag("p",i18n("Created: ") +" "); + addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); + + } + if ( mModified ) { + addTag("p",i18n("Last modified: ") +" "); + addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); + + } } @@ -212,16 +226,24 @@ void KIncidenceFormatter::setTodo(Todo *event ) addTag("p",i18n("Access: ") +event->secrecyStr() ); formatCategories(event); - if (!event->description().isEmpty()) { - addTag("p",i18n("Details: ")); - addTag("p",event->description()); + if ( mDetails ) { + if (!event->description().isEmpty()) { + addTag("p",i18n("Details: ")); + addTag("p",event->description()); + } } - - - formatReadOnly(event); formatAttendees(event); - + if ( mCreated ) { + addTag("p",i18n("Created: ") +" "); + addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); + + } + if ( mModified ) { + addTag("p",i18n("Last modified: ") +" "); + addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); + + } } void KIncidenceFormatter::setJournal(Journal* ) diff --git a/libkcal/kincidenceformatter.h b/libkcal/kincidenceformatter.h index 6165a9f..068e6d2 100644 --- a/libkcal/kincidenceformatter.h +++ b/libkcal/kincidenceformatter.h @@ -17,7 +17,7 @@ class KIncidenceFormatter : public QObject static KIncidenceFormatter* instance(); KIncidenceFormatter(); ~KIncidenceFormatter(); - QString getFormattedText( Incidence * inc ); + QString getFormattedText( Incidence * inc , bool details = false, bool created = false, bool modified = false ); void setEvent(Event *event); void setTodo(Todo *event ); @@ -33,6 +33,7 @@ class KIncidenceFormatter : public QObject private: bool mSyncMode; + bool mDetails, mCreated ,mModified; QString mText; Incidence* mCurrentIncidence; -- cgit v0.9.0.2