summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.cpp
authorzautrix <zautrix>2005-06-08 12:35:38 (UTC)
committer zautrix <zautrix>2005-06-08 12:35:38 (UTC)
commitd9e240cf1a88f4213c9169e9168d01b669613312 (patch) (unidiff)
treeed22cb872cc0f38625afe0f01036a48eb9b3edfa /libkcal/incidence.cpp
parent2448916479b456ca7c880427a80e8e32e95b2fba (diff)
downloadkdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.zip
kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.tar.gz
kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.tar.bz2
better export
Diffstat (limited to 'libkcal/incidence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp11
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
405QString Incidence::categoriesStr() 405QString Incidence::categoriesStr()
406{ 406{
407 return mCategories.join(","); 407 return mCategories.join(",");
408} 408}
409QString Incidence::categoriesStrWithSpace() 409QString Incidence::categoriesStrWithSpace()
410{ 410{
411 return mCategories.join(", "); 411 return mCategories.join(", ");
412} 412}
413 413
414void Incidence::setRelatedToUid(const QString &relatedToUid) 414void 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
420QString Incidence::relatedToUid() const 420QString Incidence::relatedToUid() const
421{ 421{
422 return mRelatedToUid; 422 return mRelatedToUid;
423} 423}
424 424
425void Incidence::setRelatedTo(Incidence *relatedTo) 425void 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
443Incidence *Incidence::relatedTo() const 443Incidence *Incidence::relatedTo() const
444{ 444{
445 return mRelatedTo; 445 return mRelatedTo;
446} 446}
447 447
448QPtrList<Incidence> Incidence::relations() const 448QPtrList<Incidence> Incidence::relations() const
449{ 449{
450 return mRelations; 450 return mRelations;
451} 451}
452 452
453void 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
453void Incidence::addRelation(Incidence *event) 464void 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
461void Incidence::removeRelation(Incidence *event) 472void 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
469bool Incidence::recursOn(const QDate &qd) const 480bool 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
475void Incidence::setExDates(const DateList &exDates) 486void 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
485void Incidence::addExDate(const QDate &date) 496void 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
495DateList Incidence::exDates() const 506DateList Incidence::exDates() const
496{ 507{
497 return mExDates; 508 return mExDates;
498} 509}
499 510
500bool Incidence::isException(const QDate &date) const 511bool Incidence::isException(const QDate &date) const