author | umopapisdn <umopapisdn> | 2003-03-23 20:49:17 (UTC) |
---|---|---|
committer | umopapisdn <umopapisdn> | 2003-03-23 20:49:17 (UTC) |
commit | 90772042f0d726149093675cede488676a94562b (patch) (side-by-side diff) | |
tree | 853a03e23255c8b8fdfd74cc284cbd02663c94a7 | |
parent | b5606a63c9f3524f9475b6ac79f0b6bcc7162fa6 (diff) | |
download | opie-90772042f0d726149093675cede488676a94562b.zip opie-90772042f0d726149093675cede488676a94562b.tar.gz opie-90772042f0d726149093675cede488676a94562b.tar.bz2 |
Bugfix: (bug #0000211) Events ending at mat the following day. Fix for weeklistview.
-rw-r--r-- | core/pim/datebook/datebookweeklst.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp index 9089fe9..e8e12ba 100644 --- a/core/pim/datebook/datebookweeklst.cpp +++ b/core/pim/datebook/datebookweeklst.cpp @@ -138,39 +138,39 @@ void DateBookWeekLstDayHdr::newEvent() { stop.setTime(QTime(12,0)); emit addEvent(start,stop,""); } DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, QWidget* parent, const char* name, WFlags fl) : OClickableLabel(parent,name,fl), event(ev) { char s[10]; - if ( ev.startDate() != ev.date() ) { // multiday event (not first day) - if ( ev.endDate() == ev.date() ) { // last day - strcpy(s, "__|__"); - } else { - strcpy(s, " |---"); - } - } else { - if(ev.event().type() == Event::Normal ) - sprintf(s,"%.2d:%.2d",ev.start().hour(),ev.start().minute()); - else - sprintf(s," "); - } - setText(QString(s) + " " + ev.description()); - connect(this, SIGNAL(clicked()), this, SLOT(editMe())); - setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); + if ( ev.startDate() != ev.date() ) { // multiday event (not first day) + if ( ev.endDate() == ev.date() ) { // last day + strcpy(s, "__|__"); + } else { + strcpy(s, " |---"); + } + } else { + if(ev.event().type() == Event::Normal ) + sprintf(s,"%.2d:%.2d",ev.start().hour(),ev.start().minute()); + else + sprintf(s," "); + } + setText(QString(s) + " " + ev.description()); + connect(this, SIGNAL(clicked()), this, SLOT(editMe())); + setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); } void DateBookWeekLstEvent::editMe() { emit editEvent(event.event()); } DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, const QDate &d, bool onM, QWidget* parent, const char* name, WFlags fl) : QWidget( parent, name, fl ) { @@ -199,29 +199,31 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList<EffectiveEvent> &ev, connect(hdr, SIGNAL(showDate(int,int,int)), this, SIGNAL(showDate(int,int,int))); connect(hdr, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &)), this, SIGNAL(addEvent(const QDateTime &, const QDateTime &, const QString &))); layout->addWidget(hdr); // Events while ( (*it).date().dayOfWeek() == dayOrder[i] && it!=ev.end() ) { - DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this); - layout->addWidget(l); - connect (l, SIGNAL(editEvent(const Event &)), - this, SIGNAL(editEvent(const Event &))); - it++; + if(!((*it).end().hour()==(*it).start().hour() && (*it).end().minute()==(*it).start().minute())) { // Skip effective events with no duration. (i.e ending at 00:00) + DateBookWeekLstEvent *l=new DateBookWeekLstEvent(*it,this); + layout->addWidget(l); + connect (l, SIGNAL(editEvent(const Event &)), + this, SIGNAL(editEvent(const Event &))); + } + it++; } layout->addItem(new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding)); } } DateBookWeekLstView::~DateBookWeekLstView(){} void DateBookWeekLstView::keyPressEvent(QKeyEvent *e) {e->ignore();} DateBookWeekLstDblView::DateBookWeekLstDblView(QValueList<EffectiveEvent> &ev1, QValueList<EffectiveEvent> &ev2, QDate &d, bool onM, QWidget* parent, |