-rw-r--r-- | libkcal/calendar.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 5092d1a..a662eeb 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp | |||
@@ -427,39 +427,39 @@ void Calendar::setupRelations( Incidence *incidence ) | |||
427 | } | 427 | } |
428 | 428 | ||
429 | // If a task with subtasks is deleted, move it's subtasks to the orphans list | 429 | // If a task with subtasks is deleted, move it's subtasks to the orphans list |
430 | void Calendar::removeRelations( Incidence *incidence ) | 430 | void Calendar::removeRelations( Incidence *incidence ) |
431 | { | 431 | { |
432 | // qDebug("Calendar::removeRelations "); | 432 | // qDebug("Calendar::removeRelations "); |
433 | QString uid = incidence->uid(); | 433 | QString uid = incidence->uid(); |
434 | 434 | ||
435 | QPtrList<Incidence> relations = incidence->relations(); | 435 | QPtrList<Incidence> relations = incidence->relations(); |
436 | for( Incidence* i = relations.first(); i; i = relations.next() ) | 436 | for( Incidence* i = relations.first(); i; i = relations.next() ) |
437 | if( !mOrphanUids.find( i->uid() ) ) { | 437 | if( !mOrphanUids.find( i->uid() ) ) { |
438 | mOrphans.insert( uid, i ); | 438 | mOrphans.insert( uid, i ); |
439 | mOrphanUids.insert( i->uid(), i ); | 439 | mOrphanUids.insert( i->uid(), i ); |
440 | i->setRelatedTo( 0 ); | 440 | i->setRelatedTo( 0 ); |
441 | i->setRelatedToUid( uid ); | 441 | i->setRelatedToUid( uid ); |
442 | } | 442 | } |
443 | 443 | ||
444 | // If this incidence is related to something else, tell that about it | 444 | // If this incidence is related to something else, tell that about it |
445 | if( incidence->relatedTo() ) | 445 | if( incidence->relatedTo() ) |
446 | incidence->relatedTo()->removeRelation( incidence ); | 446 | incidence->relatedTo()->removeRelation( incidence ); |
447 | 447 | ||
448 | // Remove this one from the orphans list | 448 | // Remove this one from the orphans list |
449 | if( mOrphanUids.remove( uid ) ) | 449 | if( mOrphanUids.remove( uid ) ) |
450 | // This incidence is located in the orphans list - it should be removed | 450 | // This incidence is located in the orphans list - it should be removed |
451 | if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) { | 451 | if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) { |
452 | // Removing wasn't that easy | 452 | // Removing wasn't that easy |
453 | for( QDictIterator<Incidence> it( mOrphans ); it.current(); ++it ) { | 453 | for( QDictIterator<Incidence> it( mOrphans ); it.current(); ++it ) { |
454 | if( it.current()->uid() == uid ) { | 454 | if( it.current()->uid() == uid ) { |
455 | mOrphans.remove( it.currentKey() ); | 455 | mOrphans.remove( it.currentKey() ); |
456 | break; | 456 | break; |
457 | } | 457 | } |
458 | } | 458 | } |
459 | } | 459 | } |
460 | } | 460 | } |
461 | 461 | ||
462 | void Calendar::registerObserver( Observer *observer ) | 462 | void Calendar::registerObserver( Observer *observer ) |
463 | { | 463 | { |
464 | mObserver = observer; | 464 | mObserver = observer; |
465 | mNewObserver = true; | 465 | mNewObserver = true; |