-rw-r--r-- | libkcal/incidence.cpp | 13 | ||||
-rw-r--r-- | libkcal/incidence.h | 2 | ||||
-rw-r--r-- | libkcal/incidencebase.cpp | 13 | ||||
-rw-r--r-- | libkcal/incidencebase.h | 2 |
4 files changed, 29 insertions, 1 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 39c14f5..fe9f854 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -343,4 +343,10 @@ void Incidence::setLastModifiedSubInvalid() mRelatedTo->setLastModifiedSubInvalid(); } +QString Incidence::lastModifiedSubSortKey() const +{ + if ( mLastModifiedSubSortKey.isEmpty() ) + return lastModifiedSortKey(); + return mLastModifiedSubSortKey; +} QDateTime Incidence::lastModifiedSub() { @@ -356,4 +362,11 @@ QDateTime Incidence::lastModifiedSub() 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; } diff --git a/libkcal/incidence.h b/libkcal/incidence.h index eef9e64..dc49640 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h @@ -280,4 +280,5 @@ class Incidence : public IncidenceBase bool isAnniversary() const; QDateTime lastModifiedSub(); + QString lastModifiedSubSortKey() const; QString recurrenceText() const; void setLastModifiedSubInvalid(); @@ -293,4 +294,5 @@ protected: private: void checkCategories(); + QString mLastModifiedSubSortKey; bool mHoliday, mBirthday, mAnniversary; int mRevision; diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 022dead..cfef973 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -194,5 +194,5 @@ QString IncidenceBase::uid() const void IncidenceBase::setLastModifiedSubInvalid() { - + // virtual method } void IncidenceBase::setLastModified(const QDateTime &lm) @@ -202,7 +202,18 @@ void IncidenceBase::setLastModified(const QDateTime &lm) // Calendar::updateEvent(). mLastModified = getEvenTime(lm); + mLastModifiedKey.sprintf("%04d%02d%02d%02d%02d%02d", + mLastModified.date().year(), + mLastModified.date().month(), + mLastModified.date().day(), + mLastModified.time().hour(), + mLastModified.time().minute(), + mLastModified.time().second() ); setLastModifiedSubInvalid(); //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); } +QString IncidenceBase::lastModifiedSortKey() const +{ + return mLastModifiedKey; +} QDateTime IncidenceBase::lastModified() const diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index 665c1f6..444d4c4 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h @@ -64,4 +64,5 @@ class IncidenceBase : public CustomProperties /** Return the time the incidence was last modified. */ QDateTime lastModified() const; + QString lastModifiedSortKey() const; /** sets the organizer for the event */ @@ -161,4 +162,5 @@ class IncidenceBase : public CustomProperties // base components QString mOrganizer; + QString mLastModifiedKey; QString mUid; int mCalID; |