Bug 136221 - korganzer moves recurring events when restarting or changing other events
Summary: korganzer moves recurring events when restarting or changing other events
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: OpenSUSE Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 136596 137043 142474 143298 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-24 07:52 UTC by Roman Fietze
Modified: 2007-03-22 20:24 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Fietze 2006-10-24 07:52:56 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    SuSE RPMs

I start kontact, configured so it shows the korganizer items appointments and to-dos.

I switch to the calendar.

I enter e.g. a new event with a start time of Oct 26, 15:00, an end time of Oct 26, 16:00, and set the recurrence to weekly, every two weeks on thursday.

When I store that event and check it in the calendar window everything is fine.

Now I switch to kontct's summary view an I see these items starting with Oct 26, Nov 09, Nov 23 and so on. That's fine.

I switch back to calendar view and exit kontact.

When I restart kontact again, this entry has changed. It now has the following settings: Start ***Nov 23***, 15:00, End Oct 26, 16:00, recurrence every second thursday.

This can also happen, when I switch forth and back between calendar and summary view and add other events, eventually with the requirement to add that new event at the same day or before the recurring event.

If you need more tests or information, please feel free to ask.
Comment 1 Bram Schoenmakers 2006-11-01 20:47:47 UTC
*** Bug 136596 has been marked as a duplicate of this bug. ***
Comment 2 Reinhold Kainhofer 2006-11-02 19:15:09 UTC
Reassigning all KOrganizer bug reports and wishes to the newly created 
korganizer-devel mailing list.
Comment 3 David 2006-11-04 03:25:48 UTC
This bug also occurs with the 3.5.5 on Kubuntu Edgy 6.10.

It is very serious, as it causes loss of recurring appointments. There is no real way to restore them; adding them again does not work as the bug will simply eat it up again. The easiest way to work around this is to create a series of non recurring events in place of all recurring events, and this is hardly ideal.
Comment 4 Bram Schoenmakers 2006-11-04 11:43:51 UTC
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
Comment 5 Bram Schoenmakers 2006-11-08 19:02:04 UTC
*** Bug 137043 has been marked as a duplicate of this bug. ***
Comment 6 Bram Schoenmakers 2007-03-04 12:34:35 UTC
*** Bug 142474 has been marked as a duplicate of this bug. ***
Comment 7 Bram Schoenmakers 2007-03-22 20:24:16 UTC
*** Bug 143298 has been marked as a duplicate of this bug. ***