summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.cpp
Unidiff
Diffstat (limited to 'libkcal/incidence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp6
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
470QStringList* Incidence::categoriesP() 470QStringList* Incidence::categoriesP()
471{ 471{
472 return &mCategories; 472 return &mCategories;
473} 473}
474 474
475QStringList Incidence::categories() const 475QStringList Incidence::categories() const
476{ 476{
477 return mCategories; 477 return mCategories;
478} 478}
479 479
480QString Incidence::categoriesStr() 480QString Incidence::categoriesStr()
481{ 481{
482 return mCategories.join(","); 482 return mCategories.join(",");
483} 483}
484QString Incidence::categoriesStrWithSpace() 484QString Incidence::categoriesStrWithSpace()
485{ 485{
486 return mCategories.join(", "); 486 return mCategories.join(", ");
487} 487}
488 488
489void Incidence::setRelatedToUid(const QString &relatedToUid) 489void Incidence::setRelatedToUid(const QString &relatedToUid)
490{ 490{
491 if (mReadOnly) return; 491 if (mReadOnly) return;
492 mRelatedToUid = relatedToUid; 492 mRelatedToUid = relatedToUid;
493} 493}
494 494void Incidence::clearRelations()
495{
496 mRelatedTo = 0;
497 mRelations.clear();
498}
495QString Incidence::relatedToUid() const 499QString Incidence::relatedToUid() const
496{ 500{
497 return mRelatedToUid; 501 return mRelatedToUid;
498} 502}
499 503
500void Incidence::setRelatedTo(Incidence *relatedTo) 504void 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
518Incidence *Incidence::relatedTo() const 522Incidence *Incidence::relatedTo() const
519{ 523{
520 return mRelatedTo; 524 return mRelatedTo;
521} 525}
522 526
523QPtrList<Incidence> Incidence::relations() const 527QPtrList<Incidence> Incidence::relations() const
524{ 528{
525 return mRelations; 529 return mRelations;
526} 530}