-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 @@ -39,6 +39,7 @@ Incidence::Incidence() : mHasStartDate = true; mAlarms.setAutoDelete(true); mAttachments.setAutoDelete(true); + mHasRecurrenceID = false; } Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) @@ -71,7 +72,8 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) ++it; } mAlarms.setAutoDelete(true); - + mHasRecurrenceID = i.mHasRecurrenceID; + mRecurrenceID = i.mRecurrenceID; mRecurrence = new Recurrence( *(i.mRecurrence), this ); } @@ -87,6 +89,26 @@ Incidence::~Incidence() 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 { @@ -143,6 +165,16 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) } #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() ) { @@ -170,6 +202,7 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) i1.resources() == i2.resources() && i1.secrecy() == i2.secrecy() && i1.priority() == i2.priority() && + i1.cancelled() == i2.cancelled() && stringCompare( i1.location(), i2.location() ); } |