author | zautrix <zautrix> | 2005-06-08 12:35:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-08 12:35:38 (UTC) |
commit | d9e240cf1a88f4213c9169e9168d01b669613312 (patch) (unidiff) | |
tree | ed22cb872cc0f38625afe0f01036a48eb9b3edfa /libkcal/incidence.cpp | |
parent | 2448916479b456ca7c880427a80e8e32e95b2fba (diff) | |
download | kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.zip kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.tar.gz kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.tar.bz2 |
better export
-rw-r--r-- | libkcal/incidence.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index f446197..4382416 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -405,96 +405,107 @@ QStringList Incidence::categories() const | |||
405 | QString Incidence::categoriesStr() | 405 | QString Incidence::categoriesStr() |
406 | { | 406 | { |
407 | return mCategories.join(","); | 407 | return mCategories.join(","); |
408 | } | 408 | } |
409 | QString Incidence::categoriesStrWithSpace() | 409 | QString Incidence::categoriesStrWithSpace() |
410 | { | 410 | { |
411 | return mCategories.join(", "); | 411 | return mCategories.join(", "); |
412 | } | 412 | } |
413 | 413 | ||
414 | void Incidence::setRelatedToUid(const QString &relatedToUid) | 414 | void Incidence::setRelatedToUid(const QString &relatedToUid) |
415 | { | 415 | { |
416 | if (mReadOnly) return; | 416 | if (mReadOnly) return; |
417 | mRelatedToUid = relatedToUid; | 417 | mRelatedToUid = relatedToUid; |
418 | } | 418 | } |
419 | 419 | ||
420 | QString Incidence::relatedToUid() const | 420 | QString Incidence::relatedToUid() const |
421 | { | 421 | { |
422 | return mRelatedToUid; | 422 | return mRelatedToUid; |
423 | } | 423 | } |
424 | 424 | ||
425 | void Incidence::setRelatedTo(Incidence *relatedTo) | 425 | void Incidence::setRelatedTo(Incidence *relatedTo) |
426 | { | 426 | { |
427 | //qDebug("Incidence::setRelatedTo %d ", relatedTo); | 427 | //qDebug("Incidence::setRelatedTo %d ", relatedTo); |
428 | //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); | 428 | //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); |
429 | if (mReadOnly || mRelatedTo == relatedTo) return; | 429 | if (mReadOnly || mRelatedTo == relatedTo) return; |
430 | if(mRelatedTo) { | 430 | if(mRelatedTo) { |
431 | // updated(); | 431 | // updated(); |
432 | mRelatedTo->removeRelation(this); | 432 | mRelatedTo->removeRelation(this); |
433 | } | 433 | } |
434 | mRelatedTo = relatedTo; | 434 | mRelatedTo = relatedTo; |
435 | if (mRelatedTo) { | 435 | if (mRelatedTo) { |
436 | mRelatedTo->addRelation(this); | 436 | mRelatedTo->addRelation(this); |
437 | mRelatedToUid = mRelatedTo->uid(); | 437 | mRelatedToUid = mRelatedTo->uid(); |
438 | } else { | 438 | } else { |
439 | mRelatedToUid = ""; | 439 | mRelatedToUid = ""; |
440 | } | 440 | } |
441 | } | 441 | } |
442 | 442 | ||
443 | Incidence *Incidence::relatedTo() const | 443 | Incidence *Incidence::relatedTo() const |
444 | { | 444 | { |
445 | return mRelatedTo; | 445 | return mRelatedTo; |
446 | } | 446 | } |
447 | 447 | ||
448 | QPtrList<Incidence> Incidence::relations() const | 448 | QPtrList<Incidence> Incidence::relations() const |
449 | { | 449 | { |
450 | return mRelations; | 450 | return mRelations; |
451 | } | 451 | } |
452 | 452 | ||
453 | void Incidence::addRelationsToList(QPtrList<Incidence> *rel) | ||
454 | { | ||
455 | Incidence* inc; | ||
456 | QPtrList<Incidence> Relations = relations(); | ||
457 | for (inc=Relations.first();inc;inc=Relations.next()) { | ||
458 | inc->addRelationsToList( rel ); | ||
459 | } | ||
460 | if ( rel->findRef( this ) == -1 ) | ||
461 | rel->append( this ); | ||
462 | } | ||
463 | |||
453 | void Incidence::addRelation(Incidence *event) | 464 | void Incidence::addRelation(Incidence *event) |
454 | { | 465 | { |
455 | if( mRelations.findRef( event ) == -1 ) { | 466 | if( mRelations.findRef( event ) == -1 ) { |
456 | mRelations.append(event); | 467 | mRelations.append(event); |
457 | //updated(); | 468 | //updated(); |
458 | } | 469 | } |
459 | } | 470 | } |
460 | 471 | ||
461 | void Incidence::removeRelation(Incidence *event) | 472 | void Incidence::removeRelation(Incidence *event) |
462 | { | 473 | { |
463 | 474 | ||
464 | mRelations.removeRef(event); | 475 | mRelations.removeRef(event); |
465 | 476 | ||
466 | // if (event->getRelatedTo() == this) event->setRelatedTo(0); | 477 | // if (event->getRelatedTo() == this) event->setRelatedTo(0); |
467 | } | 478 | } |
468 | 479 | ||
469 | bool Incidence::recursOn(const QDate &qd) const | 480 | bool Incidence::recursOn(const QDate &qd) const |
470 | { | 481 | { |
471 | if (recurrence()->recursOnPure(qd) && !isException(qd)) return true; | 482 | if (recurrence()->recursOnPure(qd) && !isException(qd)) return true; |
472 | else return false; | 483 | else return false; |
473 | } | 484 | } |
474 | 485 | ||
475 | void Incidence::setExDates(const DateList &exDates) | 486 | void Incidence::setExDates(const DateList &exDates) |
476 | { | 487 | { |
477 | if (mReadOnly) return; | 488 | if (mReadOnly) return; |
478 | mExDates = exDates; | 489 | mExDates = exDates; |
479 | 490 | ||
480 | recurrence()->setRecurExDatesCount(mExDates.count()); | 491 | recurrence()->setRecurExDatesCount(mExDates.count()); |
481 | 492 | ||
482 | updated(); | 493 | updated(); |
483 | } | 494 | } |
484 | 495 | ||
485 | void Incidence::addExDate(const QDate &date) | 496 | void Incidence::addExDate(const QDate &date) |
486 | { | 497 | { |
487 | if (mReadOnly) return; | 498 | if (mReadOnly) return; |
488 | mExDates.append(date); | 499 | mExDates.append(date); |
489 | 500 | ||
490 | recurrence()->setRecurExDatesCount(mExDates.count()); | 501 | recurrence()->setRecurExDatesCount(mExDates.count()); |
491 | 502 | ||
492 | updated(); | 503 | updated(); |
493 | } | 504 | } |
494 | 505 | ||
495 | DateList Incidence::exDates() const | 506 | DateList Incidence::exDates() const |
496 | { | 507 | { |
497 | return mExDates; | 508 | return mExDates; |
498 | } | 509 | } |
499 | 510 | ||
500 | bool Incidence::isException(const QDate &date) const | 511 | bool Incidence::isException(const QDate &date) const |