summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2005-04-05 10:34:37 (UTC)
committer zautrix <zautrix>2005-04-05 10:34:37 (UTC)
commit854e1b46d7895bf4860d914abb5f1e954dfbfe6a (patch) (unidiff)
tree0636047ee54238f5d2b864bb0b0419e65311c91b /libkcal
parent141c73d9ee02cff6fc2a56289bd8c85bbf60df02 (diff)
downloadkdepimpi-854e1b46d7895bf4860d914abb5f1e954dfbfe6a.zip
kdepimpi-854e1b46d7895bf4860d914abb5f1e954dfbfe6a.tar.gz
kdepimpi-854e1b46d7895bf4860d914abb5f1e954dfbfe6a.tar.bz2
fix
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 9a36939..a312ba5 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -203,96 +203,97 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
203 if ( i1.hasStartDate() == i2.hasStartDate() ) { 203 if ( i1.hasStartDate() == i2.hasStartDate() ) {
204 if ( i1.hasStartDate() ) { 204 if ( i1.hasStartDate() ) {
205 if ( i1.dtStart() != i2.dtStart() ) 205 if ( i1.dtStart() != i2.dtStart() )
206 return false; 206 return false;
207 } 207 }
208 } else { 208 } else {
209 return false; 209 return false;
210 } 210 }
211 if (!( *i1.recurrence() == *i2.recurrence()) ) { 211 if (!( *i1.recurrence() == *i2.recurrence()) ) {
212 qDebug("recurrence is NOT equal "); 212 qDebug("recurrence is NOT equal ");
213 return false; 213 return false;
214 } 214 }
215 return 215 return
216 // i1.created() == i2.created() && 216 // i1.created() == i2.created() &&
217 stringCompare( i1.description(), i2.description() ) && 217 stringCompare( i1.description(), i2.description() ) &&
218 stringCompare( i1.summary(), i2.summary() ) && 218 stringCompare( i1.summary(), i2.summary() ) &&
219 i1.categories() == i2.categories() && 219 i1.categories() == i2.categories() &&
220 // no need to compare mRelatedTo 220 // no need to compare mRelatedTo
221 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) && 221 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) &&
222 // i1.relations() == i2.relations() && 222 // i1.relations() == i2.relations() &&
223 i1.exDates() == i2.exDates() && 223 i1.exDates() == i2.exDates() &&
224 i1.attachments() == i2.attachments() && 224 i1.attachments() == i2.attachments() &&
225 i1.resources() == i2.resources() && 225 i1.resources() == i2.resources() &&
226 i1.secrecy() == i2.secrecy() && 226 i1.secrecy() == i2.secrecy() &&
227 i1.priority() == i2.priority() && 227 i1.priority() == i2.priority() &&
228 i1.cancelled() == i2.cancelled() && 228 i1.cancelled() == i2.cancelled() &&
229 stringCompare( i1.location(), i2.location() ); 229 stringCompare( i1.location(), i2.location() );
230} 230}
231 231
232Incidence* Incidence::recreateCloneException( QDate d ) 232Incidence* Incidence::recreateCloneException( QDate d )
233{ 233{
234 Incidence* newInc = clone(); 234 Incidence* newInc = clone();
235 newInc->recreate(); 235 newInc->recreate();
236 if ( doesRecur() ) { 236 if ( doesRecur() ) {
237 addExDate( d ); 237 addExDate( d );
238 newInc->recurrence()->unsetRecurs(); 238 newInc->recurrence()->unsetRecurs();
239 if ( type() == "Event") { 239 if ( type() == "Event") {
240 int len = dtStart().secsTo( ((Event*)this)->dtEnd()); 240 int len = dtStart().secsTo( ((Event*)this)->dtEnd());
241 QTime tim = dtStart().time(); 241 QTime tim = dtStart().time();
242 newInc->setDtStart( QDateTime(d, tim) ); 242 newInc->setDtStart( QDateTime(d, tim) );
243 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); 243 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
244 } else { 244 } else {
245 int len = dtStart().secsTo( ((Todo*)this)->dtDue()); 245 int len = dtStart().secsTo( ((Todo*)this)->dtDue());
246 QTime tim = ((Todo*)this)->dtDue().time(); 246 QTime tim = ((Todo*)this)->dtDue().time();
247 ((Todo*)newInc)->setDtDue( QDateTime(d, tim) ); 247 ((Todo*)newInc)->setDtDue( QDateTime(d, tim) );
248 ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) ); 248 ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) );
249 ((Todo*)this)->setRecurDates(); 249 ((Todo*)this)->setRecurDates();
250 } 250 }
251 newInc->setExDates( DateList () );
251 } 252 }
252 return newInc; 253 return newInc;
253} 254}
254 255
255void Incidence::recreate() 256void Incidence::recreate()
256{ 257{
257 setCreated(QDateTime::currentDateTime()); 258 setCreated(QDateTime::currentDateTime());
258 259
259 setUid(CalFormat::createUniqueId()); 260 setUid(CalFormat::createUniqueId());
260 261
261 setRevision(0); 262 setRevision(0);
262 setIDStr( ":" ); 263 setIDStr( ":" );
263 setLastModified(QDateTime::currentDateTime()); 264 setLastModified(QDateTime::currentDateTime());
264} 265}
265 266
266void Incidence::setReadOnly( bool readOnly ) 267void Incidence::setReadOnly( bool readOnly )
267{ 268{
268 IncidenceBase::setReadOnly( readOnly ); 269 IncidenceBase::setReadOnly( readOnly );
269 recurrence()->setRecurReadOnly( readOnly); 270 recurrence()->setRecurReadOnly( readOnly);
270} 271}
271 272
272void Incidence::setCreated(QDateTime created) 273void Incidence::setCreated(QDateTime created)
273{ 274{
274 if (mReadOnly) return; 275 if (mReadOnly) return;
275 mCreated = getEvenTime(created); 276 mCreated = getEvenTime(created);
276} 277}
277 278
278QDateTime Incidence::created() const 279QDateTime Incidence::created() const
279{ 280{
280 return mCreated; 281 return mCreated;
281} 282}
282 283
283void Incidence::setRevision(int rev) 284void Incidence::setRevision(int rev)
284{ 285{
285 if (mReadOnly) return; 286 if (mReadOnly) return;
286 mRevision = rev; 287 mRevision = rev;
287 288
288 updated(); 289 updated();
289} 290}
290 291
291int Incidence::revision() const 292int Incidence::revision() const
292{ 293{
293 return mRevision; 294 return mRevision;
294} 295}
295 296
296void Incidence::setDtStart(const QDateTime &dtStart) 297void Incidence::setDtStart(const QDateTime &dtStart)
297{ 298{
298 299