KCalCore::Calendar::CalendarObserver gets notified via calendarIncidenceAboutToBeDeleted() about incidence being removed from a KCalCore::Calendar. If the incidence is removed from Akonadi::CalendarBase internal hashes before calling MemoryCalendar::deleteIncidence(), then the observer no longer has any means how to resolve the incidence-about-to-be-removed back to respective Akonadi::Item. This patch moves the call to MemoryCalendar::deleteIncidence() to happen before the incidence is removed from CalendarBase internal hashes, so that observers can still query the calendar about the event from the calendarIncidenceAboutToBeDeleted() callback.
The comment in CalendarBase says, that the call to KCalCore::MemoryCalendar::deleteIncidence has to be called last due to reentrancy, however looking at the code in CalendarBasePrivate::internalRemove() and looking at the callers of that method, the position of the call does not really seem to have any effect on reentrancy of the method. Sergio, any ideas what the comment meant?