From 56de219c5ce910a470a01a0e5003d1a113837ef4 Mon Sep 17 00:00:00 2001 From: zautrix Date: Mon, 13 Jun 2005 13:57:22 +0000 Subject: fixxx --- (limited to 'libkcal/calendar.cpp') diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 5092d1a..a662eeb 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -430,33 +430,33 @@ void Calendar::setupRelations( Incidence *incidence ) void Calendar::removeRelations( Incidence *incidence ) { // qDebug("Calendar::removeRelations "); - QString uid = incidence->uid(); - - QPtrList relations = incidence->relations(); - for( Incidence* i = relations.first(); i; i = relations.next() ) - if( !mOrphanUids.find( i->uid() ) ) { - mOrphans.insert( uid, i ); - mOrphanUids.insert( i->uid(), i ); - i->setRelatedTo( 0 ); - i->setRelatedToUid( uid ); - } - - // If this incidence is related to something else, tell that about it - if( incidence->relatedTo() ) - incidence->relatedTo()->removeRelation( incidence ); - - // Remove this one from the orphans list - if( mOrphanUids.remove( uid ) ) - // This incidence is located in the orphans list - it should be removed - if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) { - // Removing wasn't that easy - for( QDictIterator it( mOrphans ); it.current(); ++it ) { - if( it.current()->uid() == uid ) { - mOrphans.remove( it.currentKey() ); - break; - } - } - } + QString uid = incidence->uid(); + + QPtrList relations = incidence->relations(); + for( Incidence* i = relations.first(); i; i = relations.next() ) + if( !mOrphanUids.find( i->uid() ) ) { + mOrphans.insert( uid, i ); + mOrphanUids.insert( i->uid(), i ); + i->setRelatedTo( 0 ); + i->setRelatedToUid( uid ); + } + + // If this incidence is related to something else, tell that about it + if( incidence->relatedTo() ) + incidence->relatedTo()->removeRelation( incidence ); + + // Remove this one from the orphans list + if( mOrphanUids.remove( uid ) ) + // This incidence is located in the orphans list - it should be removed + if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) { + // Removing wasn't that easy + for( QDictIterator it( mOrphans ); it.current(); ++it ) { + if( it.current()->uid() == uid ) { + mOrphans.remove( it.currentKey() ); + break; + } + } + } } void Calendar::registerObserver( Observer *observer ) -- cgit v0.9.0.2