From b5606a63c9f3524f9475b6ac79f0b6bcc7162fa6 Mon Sep 17 00:00:00 2001 From: umopapisdn Date: Sun, 23 Mar 2003 20:33:00 +0000 Subject: Bugfix: (bug #0000211) Events ending at mat the following day. Fix for dayview. --- (limited to 'core/pim') diff --git a/core/pim/datebook/datebookday.cpp b/core/pim/datebook/datebookday.cpp index a6a1be3..42f026a 100644 --- a/core/pim/datebook/datebookday.cpp +++ b/core/pim/datebook/datebookday.cpp @@ -303,20 +303,22 @@ void DateBookDay::redraw() void DateBookDay::getEvents() { - widgetList.clear(); - - QValueList eventList = db->getEffectiveEvents( currDate, - currDate ); - QValueListIterator it; - for ( it = eventList.begin(); it != eventList.end(); ++it ) { - DateBookDayWidget* w = new DateBookDayWidget( *it, this ); - connect( w, SIGNAL( deleteMe( const Event & ) ), - this, SIGNAL( removeEvent( const Event & ) ) ); - connect( w, SIGNAL( editMe( const Event & ) ), - this, SIGNAL( editEvent( const Event & ) ) ); - connect( w, SIGNAL( beamMe( const Event & ) ), - this, SIGNAL( beamEvent( const Event & ) ) ); - widgetList.append( w ); + widgetList.clear(); + + QValueList eventList = db->getEffectiveEvents( currDate, currDate ); + QValueListIterator it; + for ( it = eventList.begin(); it != eventList.end(); ++it ) { + EffectiveEvent ev=*it; + if(!(ev.end().hour()==ev.start().hour() && ev.end().minute()==ev.start().minute())) { // Skip effective events with no duration. (i.e ending at 00:00) + DateBookDayWidget* w = new DateBookDayWidget( *it, this ); + connect( w, SIGNAL( deleteMe( const Event & ) ), + this, SIGNAL( removeEvent( const Event & ) ) ); + connect( w, SIGNAL( editMe( const Event & ) ), + this, SIGNAL( editEvent( const Event & ) ) ); + connect( w, SIGNAL( beamMe( const Event & ) ), + this, SIGNAL( beamEvent( const Event & ) ) ); + widgetList.append( w ); + } } } @@ -360,7 +362,7 @@ void DateBookDay::relayoutPage( bool fromResize ) setUpdatesEnabled( FALSE ); if ( !fromResize ) getEvents(); // no need we already have them! - + widgetList.sort(); //sorts the widgetList by the heights of the widget so that the tallest widgets are at the beginning //this is needed for the simple algo below to work correctly, otherwise some widgets would be drawn outside the view -- cgit v0.9.0.2