author | zautrix <zautrix> | 2005-02-17 21:31:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-17 21:31:18 (UTC) |
commit | 8e8d2bd0c31eb272a7f26756252ff4930d0602bc (patch) (side-by-side diff) | |
tree | 8392e9ca561d1444bcd949e9f1aaf78f698cde98 /libkcal | |
parent | 002e4f8cea2352e4b9a046b98f66be946fbeb5fc (diff) | |
download | kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.zip kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.gz kdepimpi-8e8d2bd0c31eb272a7f26756252ff4930d0602bc.tar.bz2 |
fixes
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 32 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.h | 3 |
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 @@ -11,5 +11,5 @@ 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 @@ -18,4 +18,7 @@ QString KIncidenceFormatter::getFormattedText( Incidence * inc ) // return QString::null; // #endif + mDetails = details; + mCreated = created ; + mModified = modified; mText = ""; if ( inc->type() == "Event" ) @@ -139,13 +142,24 @@ void KIncidenceFormatter::setEvent(Event *event) // mText.append(event->secrecyStr()+"<br>"); formatCategories(event); + 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 )); + + } } @@ -213,15 +227,23 @@ void KIncidenceFormatter::setTodo(Todo *event ) addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); formatCategories(event); + 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* ) diff --git a/libkcal/kincidenceformatter.h b/libkcal/kincidenceformatter.h index 6165a9f..068e6d2 100644 --- a/libkcal/kincidenceformatter.h +++ b/libkcal/kincidenceformatter.h @@ -18,5 +18,5 @@ class KIncidenceFormatter : public QObject KIncidenceFormatter(); ~KIncidenceFormatter(); - QString getFormattedText( Incidence * inc ); + QString getFormattedText( Incidence * inc , bool details = false, bool created = false, bool modified = false ); void setEvent(Event *event); @@ -34,4 +34,5 @@ class KIncidenceFormatter : public QObject private: bool mSyncMode; + bool mDetails, mCreated ,mModified; QString mText; |