summaryrefslogtreecommitdiffabout
path: root/libkcal/kincidenceformatter.cpp
Unidiff
Diffstat (limited to 'libkcal/kincidenceformatter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 7d61b7f..d1ace4f 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -1,74 +1,74 @@
1#include "kincidenceformatter.h" 1#include "kincidenceformatter.h"
2#include <kstaticdeleter.h> 2#include <kstaticdeleter.h>
3#include <kglobal.h> 3#include <kglobal.h>
4#include <klocale.h> 4#include <klocale.h>
5#ifdef DEKTOP_VERSION 5#ifdef DEKTOP_VERSION
6#include <kabc/stdaddressbook.h> 6#include <kabc/stdaddressbook.h>
7#define size count 7#define size count
8#endif 8#endif
9 9
10KIncidenceFormatter* KIncidenceFormatter::mInstance = 0; 10KIncidenceFormatter* KIncidenceFormatter::mInstance = 0;
11static KStaticDeleter<KIncidenceFormatter> insd; 11static KStaticDeleter<KIncidenceFormatter> insd;
12 12
13QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified ) 13QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified )
14{ 14{
15// #ifndef QT_NO_INPUTDIALOG 15// #ifndef QT_NO_INPUTDIALOG
16// return QInputDialog::getItem( caption, label, items, current, editable ); 16// return QInputDialog::getItem( caption, label, items, current, editable );
17// #else 17// #else
18// return QString::null; 18// return QString::null;
19// #endif 19// #endif
20 mDetails = details; 20 mDetails = details;
21 mCreated = created ; 21 mCreated = created ;
22 mModified = modified; 22 mModified = modified;
23 mText = ""; 23 mText = "";
24 if ( inc->type() == "Event" ) 24 if ( inc->typeID() == eventID )
25 setEvent((Event *) inc ); 25 setEvent((Event *) inc );
26 else if ( inc->type() == "Todo" ) 26 else if ( inc->typeID() == todoID )
27 setTodo((Todo *) inc ); 27 setTodo((Todo *) inc );
28 return mText; 28 return mText;
29} 29}
30 30
31KIncidenceFormatter* KIncidenceFormatter::instance() 31KIncidenceFormatter* KIncidenceFormatter::instance()
32{ 32{
33 if (!mInstance) { 33 if (!mInstance) {
34 mInstance = insd.setObject(new KIncidenceFormatter()); 34 mInstance = insd.setObject(new KIncidenceFormatter());
35 } 35 }
36 return mInstance; 36 return mInstance;
37} 37}
38KIncidenceFormatter::~KIncidenceFormatter() 38KIncidenceFormatter::~KIncidenceFormatter()
39{ 39{
40 if (mInstance == this) 40 if (mInstance == this)
41 mInstance = insd.setObject(0); 41 mInstance = insd.setObject(0);
42 //qDebug("KIncidenceFormatter::~KIncidenceFormatter "); 42 //qDebug("KIncidenceFormatter::~KIncidenceFormatter ");
43} 43}
44KIncidenceFormatter::KIncidenceFormatter() 44KIncidenceFormatter::KIncidenceFormatter()
45{ 45{
46 mColorMode = 0; 46 mColorMode = 0;
47} 47}
48void KIncidenceFormatter::setEvent(Event *event) 48void KIncidenceFormatter::setEvent(Event *event)
49{ 49{
50 int mode = 0; 50 int mode = 0;
51 mCurrentIncidence = event; 51 mCurrentIncidence = event;
52 bool shortDate = true; 52 bool shortDate = true;
53 if ( mode == 0 ) { 53 if ( mode == 0 ) {
54 addTag("h3",deTag(event->summary())); 54 addTag("h3",deTag(event->summary()));
55 } 55 }
56 else { 56 else {
57 if ( mColorMode == 1 ) { 57 if ( mColorMode == 1 ) {
58 mText +="<font color=\"#00A000\">"; 58 mText +="<font color=\"#00A000\">";
59 } 59 }
60 if ( mColorMode == 2 ) { 60 if ( mColorMode == 2 ) {
61 mText +="<font color=\"#C00000\">"; 61 mText +="<font color=\"#C00000\">";
62 } 62 }
63 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 63 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
64 if ( mode == 1 ) { 64 if ( mode == 1 ) {
65 addTag("h2",i18n( "Local: " ) +deTag(event->summary())); 65 addTag("h2",i18n( "Local: " ) +deTag(event->summary()));
66 } else { 66 } else {
67 addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); 67 addTag("h2",i18n( "Remote: " ) +deTag(event->summary()));
68 } 68 }
69 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); 69 addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) );
70 if ( mColorMode ) 70 if ( mColorMode )
71 mText += "</font>"; 71 mText += "</font>";
72 } 72 }
73 if (event->cancelled ()) { 73 if (event->cancelled ()) {
74 mText +="<font color=\"#B00000\">"; 74 mText +="<font color=\"#B00000\">";