summaryrefslogtreecommitdiffabout
path: root/libkcal/calendar.cpp
Unidiff
Diffstat (limited to 'libkcal/calendar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendar.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index dc198bd..32aac7a 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -362,65 +362,65 @@ void Calendar::setupRelations( Incidence *incidence )
362 mOrphanUids.insert( incidence->uid(), incidence ); 362 mOrphanUids.insert( incidence->uid(), incidence );
363 } 363 }
364 } 364 }
365} 365}
366 366
367// If a task with subtasks is deleted, move it's subtasks to the orphans list 367// If a task with subtasks is deleted, move it's subtasks to the orphans list
368void Calendar::removeRelations( Incidence *incidence ) 368void Calendar::removeRelations( Incidence *incidence )
369{ 369{
370 // qDebug("Calendar::removeRelations "); 370 // qDebug("Calendar::removeRelations ");
371 QString uid = incidence->uid(); 371 QString uid = incidence->uid();
372 372
373 QPtrList<Incidence> relations = incidence->relations(); 373 QPtrList<Incidence> relations = incidence->relations();
374 for( Incidence* i = relations.first(); i; i = relations.next() ) 374 for( Incidence* i = relations.first(); i; i = relations.next() )
375 if( !mOrphanUids.find( i->uid() ) ) { 375 if( !mOrphanUids.find( i->uid() ) ) {
376 mOrphans.insert( uid, i ); 376 mOrphans.insert( uid, i );
377 mOrphanUids.insert( i->uid(), i ); 377 mOrphanUids.insert( i->uid(), i );
378 i->setRelatedTo( 0 ); 378 i->setRelatedTo( 0 );
379 i->setRelatedToUid( uid ); 379 i->setRelatedToUid( uid );
380 } 380 }
381 381
382 // If this incidence is related to something else, tell that about it 382 // If this incidence is related to something else, tell that about it
383 if( incidence->relatedTo() ) 383 if( incidence->relatedTo() )
384 incidence->relatedTo()->removeRelation( incidence ); 384 incidence->relatedTo()->removeRelation( incidence );
385 385
386 // Remove this one from the orphans list 386 // Remove this one from the orphans list
387 if( mOrphanUids.remove( uid ) ) 387 if( mOrphanUids.remove( uid ) )
388 // This incidence is located in the orphans list - it should be removed 388 // This incidence is located in the orphans list - it should be removed
389 if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) { 389 if( !( incidence->relatedTo() != 0 && mOrphans.remove( incidence->relatedTo()->uid() ) ) ) {
390 // Removing wasn't that easy 390 // Removing wasn't that easy
391 for( QDictIterator<Incidence> it( mOrphans ); it.current(); ++it ) { 391 for( QDictIterator<Incidence> it( mOrphans ); it.current(); ++it ) {
392 if( it.current()->uid() == uid ) { 392 if( it.current()->uid() == uid ) {
393 mOrphans.remove( it.currentKey() ); 393 mOrphans.remove( it.currentKey() );
394 break; 394 break;
395 } 395 }
396 } 396 }
397 } 397 }
398} 398}
399 399
400void Calendar::registerObserver( Observer *observer ) 400void Calendar::registerObserver( Observer *observer )
401{ 401{
402 mObserver = observer; 402 mObserver = observer;
403 mNewObserver = true; 403 mNewObserver = true;
404} 404}
405 405
406void Calendar::setModified( bool modified ) 406void Calendar::setModified( bool modified )
407{ 407{
408 if ( mObserver ) mObserver->calendarModified( modified, this ); 408 if ( mObserver ) mObserver->calendarModified( modified, this );
409 if ( modified != mModified || mNewObserver ) { 409 if ( modified != mModified || mNewObserver ) {
410 mNewObserver = false; 410 mNewObserver = false;
411 // if ( mObserver ) mObserver->calendarModified( modified, this ); 411 // if ( mObserver ) mObserver->calendarModified( modified, this );
412 mModified = modified; 412 mModified = modified;
413 } 413 }
414} 414}
415 415
416void Calendar::setLoadedProductId( const QString &id ) 416void Calendar::setLoadedProductId( const QString &id )
417{ 417{
418 mLoadedProductId = id; 418 mLoadedProductId = id;
419} 419}
420 420
421QString Calendar::loadedProductId() 421QString Calendar::loadedProductId()
422{ 422{
423 return mLoadedProductId; 423 return mLoadedProductId;
424} 424}
425 425
426#include "calendar.moc" 426//#include "calendar.moc"