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 | |
parent | 2448916479b456ca7c880427a80e8e32e95b2fba (diff) | |
download | kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.zip kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.tar.gz kdepimpi-d9e240cf1a88f4213c9169e9168d01b669613312.tar.bz2 |
better export
-rw-r--r-- | libkcal/incidence.cpp | 11 | ||||
-rw-r--r-- | libkcal/incidence.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index f446197..4382416 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -429,48 +429,59 @@ void Incidence::setRelatedTo(Incidence *relatedTo) | |||
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 | { |
diff --git a/libkcal/incidence.h b/libkcal/incidence.h index aa51e84..fc97ce9 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h | |||
@@ -92,49 +92,49 @@ class Incidence : public IncidenceBase | |||
92 | bool visit( Journal *j ) { return mResource->addJournal( j ); } | 92 | bool visit( Journal *j ) { return mResource->addJournal( j ); } |
93 | 93 | ||
94 | private: | 94 | private: |
95 | T *mResource; | 95 | T *mResource; |
96 | }; | 96 | }; |
97 | 97 | ||
98 | /** enumeration for describing an event's secrecy. */ | 98 | /** enumeration for describing an event's secrecy. */ |
99 | enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 }; | 99 | enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 }; |
100 | typedef ListBase<Incidence> List; | 100 | typedef ListBase<Incidence> List; |
101 | Incidence(); | 101 | Incidence(); |
102 | Incidence(const Incidence &); | 102 | Incidence(const Incidence &); |
103 | ~Incidence(); | 103 | ~Incidence(); |
104 | 104 | ||
105 | /** | 105 | /** |
106 | Accept IncidenceVisitor. A class taking part in the visitor mechanism has to | 106 | Accept IncidenceVisitor. A class taking part in the visitor mechanism has to |
107 | provide this implementation: | 107 | provide this implementation: |
108 | <pre> | 108 | <pre> |
109 | bool accept(Visitor &v) { return v.visit(this); } | 109 | bool accept(Visitor &v) { return v.visit(this); } |
110 | </pre> | 110 | </pre> |
111 | */ | 111 | */ |
112 | virtual bool accept(Visitor &) { return false; } | 112 | virtual bool accept(Visitor &) { return false; } |
113 | 113 | ||
114 | virtual Incidence *clone() = 0; | 114 | virtual Incidence *clone() = 0; |
115 | virtual void cloneRelations( Incidence * ); | 115 | virtual void cloneRelations( Incidence * ); |
116 | 116 | void addRelationsToList(QPtrList<Incidence> *rel); | |
117 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; | 117 | virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; |
118 | void setReadOnly( bool ); | 118 | void setReadOnly( bool ); |
119 | 119 | ||
120 | /** | 120 | /** |
121 | Recreate event. The event is made a new unique event, but already stored | 121 | Recreate event. The event is made a new unique event, but already stored |
122 | event information is preserved. Sets uniquie id, creation date, last | 122 | event information is preserved. Sets uniquie id, creation date, last |
123 | modification date and revision number. | 123 | modification date and revision number. |
124 | */ | 124 | */ |
125 | void recreate(); | 125 | void recreate(); |
126 | Incidence* recreateCloneException(QDate); | 126 | Incidence* recreateCloneException(QDate); |
127 | 127 | ||
128 | /** set creation date */ | 128 | /** set creation date */ |
129 | void setCreated(QDateTime); | 129 | void setCreated(QDateTime); |
130 | /** return time and date of creation. */ | 130 | /** return time and date of creation. */ |
131 | QDateTime created() const; | 131 | QDateTime created() const; |
132 | 132 | ||
133 | /** set the number of revisions this event has seen */ | 133 | /** set the number of revisions this event has seen */ |
134 | void setRevision(int rev); | 134 | void setRevision(int rev); |
135 | /** return the number of revisions this event has seen */ | 135 | /** return the number of revisions this event has seen */ |
136 | int revision() const; | 136 | int revision() const; |
137 | 137 | ||
138 | /** Set starting date/time. */ | 138 | /** Set starting date/time. */ |
139 | virtual void setDtStart(const QDateTime &dtStart); | 139 | virtual void setDtStart(const QDateTime &dtStart); |
140 | /** Return the incidence's ending date/time as a QDateTime. */ | 140 | /** Return the incidence's ending date/time as a QDateTime. */ |