-rw-r--r-- | libkcal/incidence.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 52d94fb..549014e 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -462,65 +462,69 @@ void Incidence::setCategories(const QString &catStr) | |||
462 | QStringList::Iterator it; | 462 | QStringList::Iterator it; |
463 | for(it = mCategories.begin();it != mCategories.end(); ++it) { | 463 | for(it = mCategories.begin();it != mCategories.end(); ++it) { |
464 | *it = (*it).stripWhiteSpace(); | 464 | *it = (*it).stripWhiteSpace(); |
465 | } | 465 | } |
466 | checkCategories(); | 466 | checkCategories(); |
467 | updated(); | 467 | updated(); |
468 | } | 468 | } |
469 | // using this makes filtering 3 times faster | 469 | // using this makes filtering 3 times faster |
470 | QStringList* Incidence::categoriesP() | 470 | QStringList* Incidence::categoriesP() |
471 | { | 471 | { |
472 | return &mCategories; | 472 | return &mCategories; |
473 | } | 473 | } |
474 | 474 | ||
475 | QStringList Incidence::categories() const | 475 | QStringList Incidence::categories() const |
476 | { | 476 | { |
477 | return mCategories; | 477 | return mCategories; |
478 | } | 478 | } |
479 | 479 | ||
480 | QString Incidence::categoriesStr() | 480 | QString Incidence::categoriesStr() |
481 | { | 481 | { |
482 | return mCategories.join(","); | 482 | return mCategories.join(","); |
483 | } | 483 | } |
484 | QString Incidence::categoriesStrWithSpace() | 484 | QString Incidence::categoriesStrWithSpace() |
485 | { | 485 | { |
486 | return mCategories.join(", "); | 486 | return mCategories.join(", "); |
487 | } | 487 | } |
488 | 488 | ||
489 | void Incidence::setRelatedToUid(const QString &relatedToUid) | 489 | void Incidence::setRelatedToUid(const QString &relatedToUid) |
490 | { | 490 | { |
491 | if (mReadOnly) return; | 491 | if (mReadOnly) return; |
492 | mRelatedToUid = relatedToUid; | 492 | mRelatedToUid = relatedToUid; |
493 | } | 493 | } |
494 | 494 | void Incidence::clearRelations() | |
495 | { | ||
496 | mRelatedTo = 0; | ||
497 | mRelations.clear(); | ||
498 | } | ||
495 | QString Incidence::relatedToUid() const | 499 | QString Incidence::relatedToUid() const |
496 | { | 500 | { |
497 | return mRelatedToUid; | 501 | return mRelatedToUid; |
498 | } | 502 | } |
499 | 503 | ||
500 | void Incidence::setRelatedTo(Incidence *relatedTo) | 504 | void Incidence::setRelatedTo(Incidence *relatedTo) |
501 | { | 505 | { |
502 | //qDebug("Incidence::setRelatedTo %d ", relatedTo); | 506 | //qDebug("Incidence::setRelatedTo %d ", relatedTo); |
503 | //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); | 507 | //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); |
504 | if (mReadOnly || mRelatedTo == relatedTo) return; | 508 | if (mReadOnly || mRelatedTo == relatedTo) return; |
505 | if(mRelatedTo) { | 509 | if(mRelatedTo) { |
506 | // updated(); | 510 | // updated(); |
507 | mRelatedTo->removeRelation(this); | 511 | mRelatedTo->removeRelation(this); |
508 | } | 512 | } |
509 | mRelatedTo = relatedTo; | 513 | mRelatedTo = relatedTo; |
510 | if (mRelatedTo) { | 514 | if (mRelatedTo) { |
511 | mRelatedTo->addRelation(this); | 515 | mRelatedTo->addRelation(this); |
512 | mRelatedToUid = mRelatedTo->uid(); | 516 | mRelatedToUid = mRelatedTo->uid(); |
513 | } else { | 517 | } else { |
514 | mRelatedToUid = ""; | 518 | mRelatedToUid = ""; |
515 | } | 519 | } |
516 | } | 520 | } |
517 | 521 | ||
518 | Incidence *Incidence::relatedTo() const | 522 | Incidence *Incidence::relatedTo() const |
519 | { | 523 | { |
520 | return mRelatedTo; | 524 | return mRelatedTo; |
521 | } | 525 | } |
522 | 526 | ||
523 | QPtrList<Incidence> Incidence::relations() const | 527 | QPtrList<Incidence> Incidence::relations() const |
524 | { | 528 | { |
525 | return mRelations; | 529 | return mRelations; |
526 | } | 530 | } |