-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 @@ -339,12 +339,18 @@ void Incidence::setReadOnly( bool readOnly ) void Incidence::setLastModifiedSubInvalid() { mLastModifiedSub = QDateTime(); if ( mRelatedTo ) mRelatedTo->setLastModifiedSubInvalid(); } +QString Incidence::lastModifiedSubSortKey() const +{ + if ( mLastModifiedSubSortKey.isEmpty() ) + return lastModifiedSortKey(); + return mLastModifiedSubSortKey; +} QDateTime Incidence::lastModifiedSub() { if ( !mRelations.count() ) return lastModified(); if ( mLastModifiedSub.isValid() ) return mLastModifiedSub; @@ -352,12 +358,19 @@ QDateTime Incidence::lastModifiedSub() Incidence * inc; QPtrList<Incidence> Relations = relations(); for (inc=Relations.first();inc;inc=Relations.next()) { if ( inc->lastModifiedSub() > mLastModifiedSub ) mLastModifiedSub = inc->lastModifiedSub(); } + mLastModifiedSubSortKey.sprintf("%04d%02d%02d%02d%02d%02d", + mLastModifiedSub.date().year(), + mLastModifiedSub.date().month(), + mLastModifiedSub.date().day(), + mLastModifiedSub.time().hour(), + mLastModifiedSub.time().minute(), + mLastModifiedSub.time().second() ); return mLastModifiedSub; } void Incidence::setCreated(QDateTime created) { if (mReadOnly) return; mCreated = getEvenTime(created); |