From 90772042f0d726149093675cede488676a94562b Mon Sep 17 00:00:00 2001 From: umopapisdn Date: Sun, 23 Mar 2003 20:49:17 +0000 Subject: Bugfix: (bug #0000211) Events ending at mat the following day. Fix for weeklistview. --- (limited to 'core/pim/datebook') 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 @@ -147,21 +147,21 @@ DateBookWeekLstEvent::DateBookWeekLstEvent(const EffectiveEvent &ev, 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()); @@ -208,11 +208,13 @@ DateBookWeekLstView::DateBookWeekLstView(QValueList &ev, // 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)); -- cgit v0.9.0.2