-rw-r--r-- | core/pim/datebook/datebookweek.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/core/pim/datebook/datebookweek.cpp b/core/pim/datebook/datebookweek.cpp index e30c776..5bbf86a 100644 --- a/core/pim/datebook/datebookweek.cpp +++ b/core/pim/datebook/datebookweek.cpp @@ -114,56 +114,58 @@ void DateBookWeekView::initNames() if ( bOnMonday ) { header->setLabel( 1, tr("M", "Monday") ); header->setLabel( 2, tr("T", "Tuesday") ); header->setLabel( 3, tr("W", "Wednesday" ) ); header->setLabel( 4, tr("T", "Thursday" ) ); header->setLabel( 5, tr("F", "Friday" ) ); header->setLabel( 6, tr("S", "Saturday" ) ); header->setLabel( 7, tr("S", "Sunday" ) ); } else { header->setLabel( 1, tr("S", "Sunday" ) ); header->setLabel( 2, tr("M", "Monday") ); header->setLabel( 3, tr("T", "Tuesday") ); header->setLabel( 4, tr("W", "Wednesday" ) ); header->setLabel( 5, tr("T", "Thursday" ) ); header->setLabel( 6, tr("F", "Friday" ) ); header->setLabel( 7, tr("S", "Saturday" ) ); } } } void DateBookWeekView::showEvents( QValueList<EffectiveEvent> &ev ) { - items.clear(); - QValueListIterator<EffectiveEvent> it; - for ( it = ev.begin(); it != ev.end(); ++it ) { - DateBookWeekItem *i = new DateBookWeekItem( *it ); - positionItem( i ); - items.append( i ); - } - viewport()->update(); + items.clear(); + QValueListIterator<EffectiveEvent> it; + for ( it = ev.begin(); it != ev.end(); ++it ) { + DateBookWeekItem *i = new DateBookWeekItem( *it ); + if(!(i->event().end().hour()==i->event().start().hour() && i->event().end().minute()==i->event().start().minute())) { // Skip effective events with no duration. (i.e ending at 00:00) + positionItem( i ); + items.append( i ); + } + } + viewport()->update(); } void DateBookWeekView::moveToHour( int h ) { int offset = h*rowHeight; setContentsPos( 0, offset ); } void DateBookWeekView::keyPressEvent( QKeyEvent *e ) { e->ignore(); } void DateBookWeekView::slotChangeClock( bool c ) { ampm = c; viewport()->update(); } static inline int db_round30min( int m ) { if ( m < 15 ) m = 0; else if ( m < 45 ) |