-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 | |||
@@ -40,4 +40,5 @@ Incidence::Incidence() : | |||
40 | mAlarms.setAutoDelete(true); | 40 | mAlarms.setAutoDelete(true); |
41 | mAttachments.setAutoDelete(true); | 41 | mAttachments.setAutoDelete(true); |
42 | mHasRecurrenceID = false; | ||
42 | } | 43 | } |
43 | 44 | ||
@@ -72,5 +73,6 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) | |||
72 | } | 73 | } |
73 | mAlarms.setAutoDelete(true); | 74 | mAlarms.setAutoDelete(true); |
74 | 75 | mHasRecurrenceID = i.mHasRecurrenceID; | |
76 | mRecurrenceID = i.mRecurrenceID; | ||
75 | mRecurrence = new Recurrence( *(i.mRecurrence), this ); | 77 | mRecurrence = new Recurrence( *(i.mRecurrence), this ); |
76 | } | 78 | } |
@@ -88,4 +90,24 @@ Incidence::~Incidence() | |||
88 | 90 | ||
89 | } | 91 | } |
92 | bool Incidence::hasRecurrenceID() const | ||
93 | { | ||
94 | return mHasRecurrenceID; | ||
95 | } | ||
96 | |||
97 | void Incidence::setHasRecurrenceID( bool b ) | ||
98 | { | ||
99 | mHasRecurrenceID = b; | ||
100 | } | ||
101 | |||
102 | void Incidence::setRecurrenceID(QDateTime d) | ||
103 | { | ||
104 | mRecurrenceID = d; | ||
105 | mHasRecurrenceID = true; | ||
106 | updated(); | ||
107 | } | ||
108 | QDateTime Incidence::recurrenceID () const | ||
109 | { | ||
110 | return mRecurrenceID; | ||
111 | } | ||
90 | 112 | ||
91 | bool Incidence::cancelled() const | 113 | bool Incidence::cancelled() const |
@@ -144,4 +166,14 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) | |||
144 | #endif | 166 | #endif |
145 | 167 | ||
168 | if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) { | ||
169 | if ( i1.hasRecurrenceID() ) { | ||
170 | if ( i1.recurrenceID() != i2.recurrenceID() ) | ||
171 | return false; | ||
172 | } | ||
173 | |||
174 | } else { | ||
175 | return false; | ||
176 | } | ||
177 | |||
146 | if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) ) | 178 | if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) ) |
147 | return false; | 179 | return false; |
@@ -171,4 +203,5 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) | |||
171 | i1.secrecy() == i2.secrecy() && | 203 | i1.secrecy() == i2.secrecy() && |
172 | i1.priority() == i2.priority() && | 204 | i1.priority() == i2.priority() && |
205 | i1.cancelled() == i2.cancelled() && | ||
173 | stringCompare( i1.location(), i2.location() ); | 206 | stringCompare( i1.location(), i2.location() ); |
174 | } | 207 | } |