-rw-r--r-- | core/pim/today/today.cpp | 28 | ||||
-rw-r--r-- | core/pim/today/today.h | 14 |
2 files changed, 25 insertions, 17 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 2dc96fc..58ba4f4 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -189,5 +189,4 @@ void Today::init() { TextLabel1->setText(QString("<font color=#FFFFFF>" + time + "</font>")); - db = new DateBookDB; // read config @@ -208,6 +207,7 @@ void Today::init() { // should only later appointments be shown or all for the current day. ONLY_LATER = cfg.readNumEntry("onlylater",1); -} + db = new DateBookDB; +} /* @@ -297,5 +297,5 @@ void Today::getDates() { if (!ONLY_LATER) { count++; - DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents); + DateBookEvent *l=new DateBookEvent(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); layoutDates->addWidget(l); connect (l, SIGNAL(editEvent(const Event &)), @@ -305,5 +305,5 @@ void Today::getDates() { // show only later appointments - DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents); + DateBookEventLater *l=new DateBookEventLater(*it, AllDateBookEvents, SHOW_LOCATION, SHOW_NOTES); layoutDates->addWidget(l); connect (l, SIGNAL(editEvent(const Event &)), @@ -443,7 +443,9 @@ Today::~Today() { */ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, - QWidget* parent = 0, - const char* name = 0, - WFlags fl = 0) : + QWidget* parent = 0, + int SHOW_LOCATION = 0, + int SHOW_NOTES = 0, + const char* name = 0, + WFlags fl = 0) : ClickableLabel(parent,name,fl), event(ev) { @@ -458,6 +460,5 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, // include location or not if (SHOW_LOCATION == 1) { - msg += "<BR><i>" + (ev).location(); - msg += "</i>"; + msg += "<BR><i>" + (ev).location() + "</i>"; } @@ -473,5 +474,5 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, // include possible note or not if (SHOW_NOTES == 1) { - msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; + msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); } } @@ -484,4 +485,6 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, QWidget* parent = 0, + int SHOW_LOCATION = 0, + int SHOW_NOTES = 0, const char* name = 0, WFlags fl = 0) : @@ -499,6 +502,5 @@ DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, // include location or not if (SHOW_LOCATION == 1) { - msg += "<BR><i>" + (ev).location(); - msg += "</i>"; + msg += "<BR><i>" + (ev).location() + "</i>"; } @@ -513,5 +515,5 @@ DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, // include possible note or not if (SHOW_NOTES == 1) { - msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; + msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP); } } diff --git a/core/pim/today/today.h b/core/pim/today/today.h index 6048781..090e8f9 100644 --- a/core/pim/today/today.h +++ b/core/pim/today/today.h @@ -79,6 +79,9 @@ class DateBookEvent: public ClickableLabel { public: DateBookEvent(const EffectiveEvent &ev, - QWidget* parent = 0, const char* name = 0, - WFlags fl = 0); + QWidget* parent = 0, + int SHOW_LOCATION = 0, + int SHOW_NOTES = 0, + const char* name = 0, + WFlags fl = 0); signals: void editEvent(const Event &e); @@ -93,6 +96,9 @@ class DateBookEventLater: public ClickableLabel { public: DateBookEventLater(const EffectiveEvent &ev, - QWidget* parent = 0, const char* name = 0, - WFlags fl = 0); + QWidget* parent = 0, + int SHOW_LOCATION = 0, + int SHOW_NOTES = 0, + const char* name = 0, + WFlags fl = 0); signals: void editEvent(const Event &e); |