From 5abbdb459be7870848ef16691174e91c68958304 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 28 Aug 2010 21:36:58 +0000 Subject: * Fixed CalDAV resource error messages and potential crash * Added write support to events with RECURRENCE-ID property Only remaining potential issue is modification of parent series and association/update/delete of child event RECURRENCE-ID fields git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1169262 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkcal/resourcecached.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'libkcal/resourcecached.cpp') diff --git a/libkcal/resourcecached.cpp b/libkcal/resourcecached.cpp index 3b654aef..155d24a0 100644 --- a/libkcal/resourcecached.cpp +++ b/libkcal/resourcecached.cpp @@ -487,12 +487,24 @@ void ResourceCached::calendarIncidenceDeleted( Incidence *i ) << i->uid() << endl; #endif - TQMap::ConstIterator it; - it = mDeletedIncidences.find( i ); - if ( it == mDeletedIncidences.end() ) { - mDeletedIncidences.insert( i, true ); + if (i->hasRecurrenceID()) { + // This incidence has a parent; notify the parent of the child's death and do not destroy the parent! + // Get the parent + IncidenceList il = i->childIncidences(); + IncidenceListIterator it; + it = il.begin(); + Incidence *parentIncidence; + parentIncidence = this->incidence(*it); + // Remove the child + calendarIncidenceChanged(parentIncidence); + } + else { + TQMap::ConstIterator it; + it = mDeletedIncidences.find( i ); + if ( it == mDeletedIncidences.end() ) { + mDeletedIncidences.insert( i, true ); + } } - checkForAutomaticSave(); } -- cgit v1.2.3