-rw-r--r-- | libkcal/incidence.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 39c14f5..fe9f854 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -333,37 +333,50 @@ void Incidence::cloneRelations( Incidence * newInc ) | |||
333 | void Incidence::setReadOnly( bool readOnly ) | 333 | void Incidence::setReadOnly( bool readOnly ) |
334 | { | 334 | { |
335 | IncidenceBase::setReadOnly( readOnly ); | 335 | IncidenceBase::setReadOnly( readOnly ); |
336 | if ( mRecurrence ) | 336 | if ( mRecurrence ) |
337 | mRecurrence->setRecurReadOnly( readOnly); | 337 | mRecurrence->setRecurReadOnly( readOnly); |
338 | } | 338 | } |
339 | void Incidence::setLastModifiedSubInvalid() | 339 | void Incidence::setLastModifiedSubInvalid() |
340 | { | 340 | { |
341 | mLastModifiedSub = QDateTime(); | 341 | mLastModifiedSub = QDateTime(); |
342 | if ( mRelatedTo ) | 342 | if ( mRelatedTo ) |
343 | mRelatedTo->setLastModifiedSubInvalid(); | 343 | mRelatedTo->setLastModifiedSubInvalid(); |
344 | } | 344 | } |
345 | QString Incidence::lastModifiedSubSortKey() const | ||
346 | { | ||
347 | if ( mLastModifiedSubSortKey.isEmpty() ) | ||
348 | return lastModifiedSortKey(); | ||
349 | return mLastModifiedSubSortKey; | ||
350 | } | ||
345 | QDateTime Incidence::lastModifiedSub() | 351 | QDateTime Incidence::lastModifiedSub() |
346 | { | 352 | { |
347 | if ( !mRelations.count() ) | 353 | if ( !mRelations.count() ) |
348 | return lastModified(); | 354 | return lastModified(); |
349 | if ( mLastModifiedSub.isValid() ) | 355 | if ( mLastModifiedSub.isValid() ) |
350 | return mLastModifiedSub; | 356 | return mLastModifiedSub; |
351 | mLastModifiedSub = lastModified(); | 357 | mLastModifiedSub = lastModified(); |
352 | Incidence * inc; | 358 | Incidence * inc; |
353 | QPtrList<Incidence> Relations = relations(); | 359 | QPtrList<Incidence> Relations = relations(); |
354 | for (inc=Relations.first();inc;inc=Relations.next()) { | 360 | for (inc=Relations.first();inc;inc=Relations.next()) { |
355 | if ( inc->lastModifiedSub() > mLastModifiedSub ) | 361 | if ( inc->lastModifiedSub() > mLastModifiedSub ) |
356 | mLastModifiedSub = inc->lastModifiedSub(); | 362 | mLastModifiedSub = inc->lastModifiedSub(); |
357 | } | 363 | } |
364 | mLastModifiedSubSortKey.sprintf("%04d%02d%02d%02d%02d%02d", | ||
365 | mLastModifiedSub.date().year(), | ||
366 | mLastModifiedSub.date().month(), | ||
367 | mLastModifiedSub.date().day(), | ||
368 | mLastModifiedSub.time().hour(), | ||
369 | mLastModifiedSub.time().minute(), | ||
370 | mLastModifiedSub.time().second() ); | ||
358 | return mLastModifiedSub; | 371 | return mLastModifiedSub; |
359 | } | 372 | } |
360 | void Incidence::setCreated(QDateTime created) | 373 | void Incidence::setCreated(QDateTime created) |
361 | { | 374 | { |
362 | if (mReadOnly) return; | 375 | if (mReadOnly) return; |
363 | mCreated = getEvenTime(created); | 376 | mCreated = getEvenTime(created); |
364 | } | 377 | } |
365 | 378 | ||
366 | QDateTime Incidence::created() const | 379 | QDateTime Incidence::created() const |
367 | { | 380 | { |
368 | return mCreated; | 381 | return mCreated; |
369 | } | 382 | } |