[Korganizer-devel] [Bug 136221] korganzer moves recurring events when restarting or changing other events

Bram Schoenmakers bramschoenmakers at kde.nl
Sat Nov 4 11:43:52 CET 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=136221         
bramschoenmakers kde nl changed:

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



------- Additional Comments From bramschoenmakers kde nl  2006-11-04 11:43 -------
SVN commit 601750 by bram:

Fix commit 587417 by winterz to handle recurring events properly in the summary widget.
Data was written to events, which is evil (bug 136221).

Now, create a separate list to prevent implicit sharing.

BUG:136221



 M  +11 -5     summarywidget.cpp  


--- branches/KDE/3.5/kdepim/kontact/plugins/korganizer/summarywidget.cpp #601749:601750
 @ -97,20 +97,26  @
   for ( dt=currentDate;
         dt<=currentDate.addDays( days - 1 );
         dt=dt.addDays(1) ) {
-    KCal::Event::List events = mCalendar->events( dt );
 
     KCal::Event *ev;
-    KCal::Event::List::ConstIterator it;
+
+    KCal::Event::List events_orig = mCalendar->events( dt );
+    KCal::Event::List::ConstIterator it = events_orig.begin();
+
+    KCal::Event::List events;
+    events.setAutoDelete( true );
     QDateTime qdt;
 
-    // Find recurring events, replacing the QDate with the currentDate
-    for ( it=events.begin(); it!=events.end(); ++it ) {
-      ev = *it;
+    // prevent implicitely sharing while finding recurring events
+    // replacing the QDate with the currentDate
+    for ( ; it != events_orig.end(); ++it ) {
+      ev = (*it)->clone();
       if ( ev->recursOn( dt ) ) {
         qdt = ev->dtStart();
         qdt.setDate( dt );
         ev->setDtStart( qdt );
       }
+      events.append( ev );
     }
 
     // sort the events for this date by summary


More information about the Korganizer-devel mailing list