From cfa6b4114cea52b167caaaeb417f98f83edd690f Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 27 Aug 2010 23:01:53 +0000 Subject: Initial (i.e. read only) support for RECURRENCE-ID modified incidence series. Write support requires further debugging and/or compliance checks with respect to Zimbra; there is no obvious reason why it should not be working but Zimbra fails with 409 when saving. User interface support is mostly complete, with event links being tracked across deletes. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1168937 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkcal/calendar.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libkcal/calendar.cpp') diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 3d57e754..0be3dffc 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -290,6 +290,25 @@ bool Calendar::addIncidence( Incidence *incidence ) bool Calendar::deleteIncidence( Incidence *incidence ) { if ( beginChange( incidence ) ) { + if (incidence->hasRecurrenceID()) { + // Delete this event's UID from the parent's list of children + Incidence *parentIncidence; + IncidenceList il = incidence->childIncidences(); + IncidenceListIterator it; + it = il.begin(); + parentIncidence = this->incidence(*it); + parentIncidence->deleteChildIncidence(incidence->uid()); + } + else { + // Delete all children as well + IncidenceList il = incidence->childIncidences(); + IncidenceListIterator it; + for ( it = il.begin(); it != il.end(); ++it ) { + deleteIncidence( this->incidence(*it) ); + // Avoid a crash, reset the iterator every time the list is modified + it = il.begin(); + } + } Incidence::DeleteVisitor v( this ); bool result = incidence->accept( v ); endChange( incidence ); -- cgit v1.2.3