author | zautrix <zautrix> | 2005-02-13 11:55:52 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-13 11:55:52 (UTC) |
commit | 0a33f91e166747406ca2ccb5819881feeecfdb40 (patch) (side-by-side diff) | |
tree | e9130a16aaa6365e106d6733c3e1adeca01f72ac /libkcal/incidence.cpp | |
parent | 00ec9899a4727a4c9100d320935dde7da4803801 (diff) | |
download | kdepimpi-0a33f91e166747406ca2ccb5819881feeecfdb40.zip kdepimpi-0a33f91e166747406ca2ccb5819881feeecfdb40.tar.gz kdepimpi-0a33f91e166747406ca2ccb5819881feeecfdb40.tar.bz2 |
todo recurchanges
-rw-r--r-- | libkcal/incidence.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index f9e1e9e..dbc159c 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -36,12 +36,13 @@ Incidence::Incidence() : mRecurrence = new Recurrence(this); mCancelled = false; recreate(); mHasStartDate = true; mAlarms.setAutoDelete(true); mAttachments.setAutoDelete(true); + mHasRecurrenceID = false; } Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) { // TODO: reenable attributes currently commented out. mRevision = i.mRevision; @@ -68,13 +69,14 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) b->setParent( this ); mAlarms.append( b ); ++it; } mAlarms.setAutoDelete(true); - + mHasRecurrenceID = i.mHasRecurrenceID; + mRecurrenceID = i.mRecurrenceID; mRecurrence = new Recurrence( *(i.mRecurrence), this ); } Incidence::~Incidence() { @@ -84,12 +86,32 @@ Incidence::~Incidence() if (ev->relatedTo() == this) ev->setRelatedTo(0); } if (relatedTo()) relatedTo()->removeRelation(this); delete mRecurrence; } +bool Incidence::hasRecurrenceID() const +{ + return mHasRecurrenceID; +} + +void Incidence::setHasRecurrenceID( bool b ) +{ + mHasRecurrenceID = b; +} + +void Incidence::setRecurrenceID(QDateTime d) +{ + mRecurrenceID = d; + mHasRecurrenceID = true; + updated(); +} +QDateTime Incidence::recurrenceID () const +{ + return mRecurrenceID; +} bool Incidence::cancelled() const { return mCancelled; } void Incidence::setCancelled( bool b ) @@ -140,12 +162,22 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) else { return false; } } #endif + if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) { + if ( i1.hasRecurrenceID() ) { + if ( i1.recurrenceID() != i2.recurrenceID() ) + return false; + } + + } else { + return false; + } + if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) ) return false; if ( i1.hasStartDate() == i2.hasStartDate() ) { if ( i1.hasStartDate() ) { if ( i1.dtStart() != i2.dtStart() ) return false; @@ -167,12 +199,13 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) // i1.relations() == i2.relations() && i1.exDates() == i2.exDates() && i1.attachments() == i2.attachments() && i1.resources() == i2.resources() && i1.secrecy() == i2.secrecy() && i1.priority() == i2.priority() && + i1.cancelled() == i2.cancelled() && stringCompare( i1.location(), i2.location() ); } Incidence* Incidence::recreateCloneException( QDate d ) { Incidence* newInc = clone(); |