author | zautrix <zautrix> | 2005-11-28 01:23:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-11-28 01:23:02 (UTC) |
commit | e08811c2246f63b2b63f9db6b65701344460f3d7 (patch) (unidiff) | |
tree | d450f486a9472d80eb86f605237b828a0e7ffae6 /libkcal/calendar.cpp | |
parent | 854d4a0c686962cd73ac7418b5fbf4b2d73adab7 (diff) | |
download | kdepimpi-e08811c2246f63b2b63f9db6b65701344460f3d7.zip kdepimpi-e08811c2246f63b2b63f9db6b65701344460f3d7.tar.gz kdepimpi-e08811c2246f63b2b63f9db6b65701344460f3d7.tar.bz2 |
ync
-rw-r--r-- | libkcal/calendar.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 8535191..1350f6d 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp | |||
@@ -2,17 +2,16 @@ | |||
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 1998 Preston Brown | 3 | Copyright (c) 1998 Preston Brown |
4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public | 7 | modify it under the terms of the GNU Library General Public |
8 | License as published by the Free Software Foundation; either | 8 | License as published by the Free Software Foundation; either |
9 | version 2 of the License, or (at your option) any later version. | 9 | version 2 of the License, or (at your option) any later version. |
10 | |||
11 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. | 13 | Library General Public License for more details. |
15 | 14 | ||
16 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
@@ -415,35 +414,39 @@ QPtrList<Todo> Calendar::todos() | |||
415 | return tl; | 414 | return tl; |
416 | } | 415 | } |
417 | 416 | ||
418 | // When this is called, the todo have already been added to the calendar. | 417 | // When this is called, the todo have already been added to the calendar. |
419 | // This method is only about linking related todos | 418 | // This method is only about linking related todos |
420 | void Calendar::setupRelations( Incidence *incidence ) | 419 | void Calendar::setupRelations( Incidence *incidence ) |
421 | { | 420 | { |
422 | QString uid = incidence->uid(); | 421 | QString uid = incidence->uid(); |
423 | //qDebug("Calendar::setupRelations "); | 422 | //qDebug("Calendar::setupRelations %s", incidence->summary().latin1()); |
424 | // First, go over the list of orphans and see if this is their parent | 423 | // First, go over the list of orphans and see if this is their parent |
425 | while( Incidence* i = mOrphans[ uid ] ) { | 424 | while( Incidence* i = mOrphans[ uid ] ) { |
426 | mOrphans.remove( uid ); | 425 | mOrphans.remove( uid ); |
427 | i->setRelatedTo( incidence ); | 426 | i->setRelatedTo( incidence ); |
427 | //qDebug("Add child %s ti inc %s", i->summary().latin1(),incidence->summary().latin1()); | ||
428 | incidence->addRelation( i ); | 428 | incidence->addRelation( i ); |
429 | mOrphanUids.remove( i->uid() ); | 429 | mOrphanUids.remove( i->uid() ); |
430 | } | 430 | } |
431 | 431 | ||
432 | // Now see about this incidences parent | 432 | // Now see about this incidences parent |
433 | if( !incidence->relatedTo() && !incidence->relatedToUid().isEmpty() ) { | 433 | if( !incidence->relatedTo() && !incidence->relatedToUid().isEmpty() ) { |
434 | // This incidence has a uid it is related to, but is not registered to it yet | 434 | // This incidence has a uid it is related to, but is not registered to it yet |
435 | // Try to find it | 435 | // Try to find it |
436 | Incidence* parent = this->incidence( incidence->relatedToUid() ); | 436 | //qDebug("Test parent for %s", incidence->summary().latin1()); |
437 | Incidence* parent = this->incidenceForUid( incidence->relatedToUid(), true ); | ||
437 | if( parent ) { | 438 | if( parent ) { |
438 | // Found it | 439 | // Found it |
440 | // qDebug("parent found for for %s", incidence->summary().latin1()); | ||
439 | incidence->setRelatedTo( parent ); | 441 | incidence->setRelatedTo( parent ); |
440 | parent->addRelation( incidence ); | 442 | parent->addRelation( incidence ); |
441 | } else { | 443 | } else { |
444 | // qDebug("NO parent found for for %s", incidence->summary().latin1()); | ||
442 | // Not found, put this in the mOrphans list | 445 | // Not found, put this in the mOrphans list |
443 | mOrphans.insert( incidence->relatedToUid(), incidence ); | 446 | mOrphans.insert( incidence->relatedToUid(), incidence ); |
444 | mOrphanUids.insert( incidence->uid(), incidence ); | 447 | mOrphanUids.insert( incidence->uid(), incidence ); |
445 | } | 448 | } |
446 | } | 449 | } |
447 | } | 450 | } |
448 | 451 | ||
449 | // If a task with subtasks is deleted, move it's subtasks to the orphans list | 452 | // If a task with subtasks is deleted, move it's subtasks to the orphans list |