Bug 53854 - crash when dragging events in the date navigation window
Summary: crash when dragging events in the date navigation window
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Cornelius Schumacher
URL:
Keywords:
: 51542 52531 64806 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-02-01 21:00 UTC by johnny
Modified: 2003-09-29 18:50 UTC (History)
4 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 johnny 2003-02-01 21:00:19 UTC
Version:           3.1 (using KDE 3.1.0)
Installed from:    compiled sources
Compiler:          gcc version 3.2.1
OS:          Linux (i686) release 2.4.20-johnny

Create an event with no time preferably taking two days (but it works with a single day event too). then drag it on the top of the date navigation tool, on any spare day of the month and it crashes.

If you need further info let me know

Thank you.
Comment 1 Cornelius Schumacher 2003-02-28 09:42:17 UTC
*** Bug 51542 has been marked as a duplicate of this bug. ***
Comment 2 Cornelius Schumacher 2003-02-28 09:42:32 UTC
*** Bug 52531 has been marked as a duplicate of this bug. ***
Comment 3 Reinhold Kainhofer 2003-08-07 13:13:46 UTC
For me this doesn't crash in current CVS (In Week view I created an event on 
Tue Aug 5, not time, and then dragged it onto Aug 16 in the small calendar on 
the left. The event was correctly copied there, no crash). If you have current 
CVS, could you test if you can still reproduce the crash.  
If it works, the bug report can now be closed as fixed. 
 
Thanks, 
Reinhold 
Comment 4 Reinhold Kainhofer 2003-09-20 19:09:57 UTC
Subject: kdepim/korganizer

CVS commit by kainhofe: 

Wahoo! Finally found the cause for bug #53854, where korganizer would randomly crash when you dragged events to the day matrix to copy/move them.

The problem was that in KODayMatrix::dropEvent we emitted eventDropped, which subsequently called updateView. This in turn rebuilt the whole agenda view (i.e. deleted all existing agenda items). However, remember that this was called in a drop event, so the code execution later on still needed the dragged agenda item, which was already deleted by the updateView. Thus the crash happens (thanks to valgrind I was able to track this down).

The solution is of course to implement KOAgendaView::changeEventDisplay to be smarter than to just recreate the whole view, when only a single event changed.
This commit implements the KOGlobals::EVENTADDED flag, so copying really works now.

I'm still working on the KOGlobals::EVENTEDITED and KOGlobals::EVENTDELETED flags (in CVS they are still calling updateView and cause that crash). The problem there is that one needs to get the KOAgendaItem(s) that is associated with the Event*event...

Anyway, the crash is fixed when you copy the event. Selecting "Move" from the popup menu still causes the crash, so the bug is not completely fixed yet.

CCMAIL: 53854@bugs.kde.org


  M +88 -44    koagendaview.cpp   1.114
  M +1 -0      koagendaview.h   1.52



Comment 5 Reinhold Kainhofer 2003-09-21 00:25:32 UTC
Subject: kdepim/korganizer

CVS commit by kainhofe: 

Finished the changeEventDisplay also for changed and deleted events. So, when the function is called, the view is not recreated completely any more, but only the changed event is removed (and the new one added in the change case). If an event is deleted, the corresponding agenda item is not immedately remove (the code execution might still be in some agenda item code, so deleting that item crashes korganizer), but instead cached and deleted later (triggered by a QTimer).

This finally fixes the last aspect of the crash when you drag events to the day matrix.

As a nice benefit, several (very expensive) calls to updateView() are removed by this.

CCMAIL: 53854-done@bugs.kde.org


  M +13 -1     koagenda.cpp   1.92
  M +9 -1      koagenda.h   1.42
  M +32 -26    koagendaview.cpp   1.116
  M +2 -1      koagendaview.h   1.53



Comment 6 Reinhold Kainhofer 2003-09-29 18:50:14 UTC
*** Bug 64806 has been marked as a duplicate of this bug. ***