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/incidence.cpp | |
parent | 854d4a0c686962cd73ac7418b5fbf4b2d73adab7 (diff) | |
download | kdepimpi-e08811c2246f63b2b63f9db6b65701344460f3d7.zip kdepimpi-e08811c2246f63b2b63f9db6b65701344460f3d7.tar.gz kdepimpi-e08811c2246f63b2b63f9db6b65701344460f3d7.tar.bz2 |
ync
-rw-r--r-- | libkcal/incidence.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index fe9f854..7dd9bd2 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -475,96 +475,102 @@ void Incidence::setCategories(const QString &catStr) | |||
475 | if (mReadOnly) return; | 475 | if (mReadOnly) return; |
476 | mCategories.clear(); | 476 | mCategories.clear(); |
477 | 477 | ||
478 | if (catStr.isEmpty()) return; | 478 | if (catStr.isEmpty()) return; |
479 | 479 | ||
480 | mCategories = QStringList::split(",",catStr); | 480 | mCategories = QStringList::split(",",catStr); |
481 | 481 | ||
482 | QStringList::Iterator it; | 482 | QStringList::Iterator it; |
483 | for(it = mCategories.begin();it != mCategories.end(); ++it) { | 483 | for(it = mCategories.begin();it != mCategories.end(); ++it) { |
484 | *it = (*it).stripWhiteSpace(); | 484 | *it = (*it).stripWhiteSpace(); |
485 | } | 485 | } |
486 | checkCategories(); | 486 | checkCategories(); |
487 | updated(); | 487 | updated(); |
488 | } | 488 | } |
489 | // using this makes filtering 3 times faster | 489 | // using this makes filtering 3 times faster |
490 | QStringList* Incidence::categoriesP() | 490 | QStringList* Incidence::categoriesP() |
491 | { | 491 | { |
492 | return &mCategories; | 492 | return &mCategories; |
493 | } | 493 | } |
494 | 494 | ||
495 | QStringList Incidence::categories() const | 495 | QStringList Incidence::categories() const |
496 | { | 496 | { |
497 | return mCategories; | 497 | return mCategories; |
498 | } | 498 | } |
499 | 499 | ||
500 | QString Incidence::categoriesStr() | 500 | QString Incidence::categoriesStr() |
501 | { | 501 | { |
502 | return mCategories.join(","); | 502 | return mCategories.join(","); |
503 | } | 503 | } |
504 | QString Incidence::categoriesStrWithSpace() | 504 | QString Incidence::categoriesStrWithSpace() |
505 | { | 505 | { |
506 | return mCategories.join(", "); | 506 | return mCategories.join(", "); |
507 | } | 507 | } |
508 | 508 | ||
509 | void Incidence::setRelatedToUid(const QString &relatedToUid) | 509 | void Incidence::setRelatedToUid(const QString &relatedToUid) |
510 | { | 510 | { |
511 | if (mReadOnly) return; | 511 | if (mReadOnly) return; |
512 | mRelatedToUid = relatedToUid; | 512 | mRelatedToUid = relatedToUid; |
513 | } | 513 | } |
514 | void Incidence::clearRelations() | 514 | void Incidence::clearRelations() |
515 | { | 515 | { |
516 | mRelatedTo = 0; | 516 | mRelatedTo = 0; |
517 | mRelations.clear(); | 517 | mRelations.clear(); |
518 | } | 518 | } |
519 | QString Incidence::relatedToUid() const | 519 | QString Incidence::relatedToUid() const |
520 | { | 520 | { |
521 | return mRelatedToUid; | 521 | return mRelatedToUid; |
522 | } | 522 | } |
523 | void Incidence::resetRelatedTo() | ||
524 | { | ||
525 | QString store = mRelatedToUid; | ||
526 | setRelatedTo( 0 ); | ||
527 | mRelatedToUid = store; | ||
528 | } | ||
523 | 529 | ||
524 | void Incidence::setRelatedTo(Incidence *relatedTo) | 530 | void Incidence::setRelatedTo(Incidence *relatedTo) |
525 | { | 531 | { |
526 | //qDebug("Incidence::setRelatedTo %d ", relatedTo); | 532 | //qDebug("Incidence::setRelatedTo %d ", relatedTo); |
527 | //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); | 533 | //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); |
528 | if (mReadOnly || mRelatedTo == relatedTo) return; | 534 | if (mReadOnly || mRelatedTo == relatedTo) return; |
529 | if(mRelatedTo) { | 535 | if(mRelatedTo) { |
530 | // updated(); | 536 | // updated(); |
531 | mRelatedTo->removeRelation(this); | 537 | mRelatedTo->removeRelation(this); |
532 | } | 538 | } |
533 | mRelatedTo = relatedTo; | 539 | mRelatedTo = relatedTo; |
534 | if (mRelatedTo) { | 540 | if (mRelatedTo) { |
535 | mRelatedTo->addRelation(this); | 541 | mRelatedTo->addRelation(this); |
536 | mRelatedToUid = mRelatedTo->uid(); | 542 | mRelatedToUid = mRelatedTo->uid(); |
537 | } else { | 543 | } else { |
538 | mRelatedToUid = ""; | 544 | mRelatedToUid = ""; |
539 | } | 545 | } |
540 | } | 546 | } |
541 | 547 | ||
542 | Incidence *Incidence::relatedTo() const | 548 | Incidence *Incidence::relatedTo() const |
543 | { | 549 | { |
544 | return mRelatedTo; | 550 | return mRelatedTo; |
545 | } | 551 | } |
546 | 552 | ||
547 | QPtrList<Incidence> Incidence::relations() const | 553 | QPtrList<Incidence> Incidence::relations() const |
548 | { | 554 | { |
549 | return mRelations; | 555 | return mRelations; |
550 | } | 556 | } |
551 | 557 | ||
552 | void Incidence::addRelationsToList(QPtrList<Incidence> *rel) | 558 | void Incidence::addRelationsToList(QPtrList<Incidence> *rel) |
553 | { | 559 | { |
554 | Incidence* inc; | 560 | Incidence* inc; |
555 | QPtrList<Incidence> Relations = relations(); | 561 | QPtrList<Incidence> Relations = relations(); |
556 | for (inc=Relations.first();inc;inc=Relations.next()) { | 562 | for (inc=Relations.first();inc;inc=Relations.next()) { |
557 | inc->addRelationsToList( rel ); | 563 | inc->addRelationsToList( rel ); |
558 | } | 564 | } |
559 | if ( rel->findRef( this ) == -1 ) | 565 | if ( rel->findRef( this ) == -1 ) |
560 | rel->append( this ); | 566 | rel->append( this ); |
561 | } | 567 | } |
562 | 568 | ||
563 | void Incidence::addRelation(Incidence *event) | 569 | void Incidence::addRelation(Incidence *event) |
564 | { | 570 | { |
565 | setLastModifiedSubInvalid(); | 571 | setLastModifiedSubInvalid(); |
566 | if( mRelations.findRef( event ) == -1 ) { | 572 | if( mRelations.findRef( event ) == -1 ) { |
567 | mRelations.append(event); | 573 | mRelations.append(event); |
568 | //updated(); | 574 | //updated(); |
569 | } | 575 | } |
570 | } | 576 | } |