[Korganizer-devel] [Bug 262310] Crash when selecting a single day after scrolling the week view [EventViews::EventIndicator::enableColumn EventViews::AgendaView::updateEventIndicatorTop EventViews::Agenda::lowerYChanged checkScrollBoundaries]

Sergio Martins iamsergio at gmail.com
Thu Jan 6 16:19:33 CET 2011


https://bugs.kde.org/show_bug.cgi?id=262310


Sergio Martins <iamsergio at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #3 from Sergio Martins <iamsergio gmail com>  2011-01-06 16:19:32 ---
commit 1c26ffc6cc90a330fad0b818490130c0ebc039d7
branch master
Author: Sergio Martins <iamsergio at gmail.com>
Date:   Thu Jan 6 15:13:37 2011 +0000

    Fix crash. Setting mEnabled and mMinY must be an atomic operation.

    Nothing should be executed in between.

    BUG: 262310

diff --git a/calendarviews/eventviews/agenda/agendaview.cpp
b/calendarviews/eventviews/agenda/agendaview.cpp
index ceb3544..e758019 100644
--- a/calendarviews/eventviews/agenda/agendaview.cpp
+++ b/calendarviews/eventviews/agenda/agendaview.cpp
@@ -257,6 +257,8 @@ class AgendaView::Private : public
CalendarSupport::Calendar::CalendarObserver
         QDate::currentDate() is returned */
     static QList<QDate> generateDateList( const QDate &start, const QDate &end
);

+    void changeColumns( int numColumns );
+
     void insertIncidence( const Akonadi::Item &incidence,
                           const QDate &curDate, bool createSelected );

@@ -267,6 +269,18 @@ class AgendaView::Private : public
CalendarSupport::Calendar::CalendarObserver
     void calendarIncidenceDeleted( const Akonadi::Item &incidence );
 };

+void AgendaView::Private::changeColumns( int numColumns )
+{
+  // mMinY, mMaxY and mEnabled must all have the same size.
+  // Make sure you preserve this order because
mEventIndicatorTop->changeColumns()
+  // can trigger a lot of stuff, and code will be executed when mMinY wasn't
resized yet.
+  mMinY.resize( numColumns );
+  mMaxY.resize( numColumns );
+  mEventIndicatorTop->changeColumns( numColumns );
+  mEventIndicatorBottom->changeColumns( numColumns );
+}
+
+
 /** static */
 QList<QDate> AgendaView::Private::generateDateList( const QDate &start,
                                                     const QDate &end )
@@ -1459,15 +1473,11 @@ void AgendaView::fillAgenda()
   if ( changes().testFlag( DatesChanged ) ) {
     d->mAllDayAgenda->changeColumns( d->mSelectedDates.count() );
     d->mAgenda->changeColumns( d->mSelectedDates.count() );
-    d->mEventIndicatorTop->changeColumns( d->mSelectedDates.count() );
-    d->mEventIndicatorBottom->changeColumns( d->mSelectedDates.count() );
+    d->changeColumns( d->mSelectedDates.count() );

     createDayLabels( false );
     setHolidayMasks();

-    d->mMinY.resize( d->mSelectedDates.count() );
-    d->mMaxY.resize( d->mSelectedDates.count() );
-
     d->mAgenda->setDateList( d->mSelectedDates );
   }

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Korganizer-devel mailing list