-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 @@ -344,2 +344,8 @@ void Incidence::setLastModifiedSubInvalid() } +QString Incidence::lastModifiedSubSortKey() const +{ + if ( mLastModifiedSubSortKey.isEmpty() ) + return lastModifiedSortKey(); + return mLastModifiedSubSortKey; +} QDateTime Incidence::lastModifiedSub() @@ -357,2 +363,9 @@ QDateTime Incidence::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 @@ -281,2 +281,3 @@ class Incidence : public IncidenceBase QDateTime lastModifiedSub(); + QString lastModifiedSubSortKey() const; QString recurrenceText() const; @@ -294,2 +295,3 @@ protected: void checkCategories(); + QString mLastModifiedSubSortKey; bool mHoliday, mBirthday, mAnniversary; diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 022dead..cfef973 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -195,3 +195,3 @@ void IncidenceBase::setLastModifiedSubInvalid() { - + // virtual method } @@ -203,2 +203,9 @@ void IncidenceBase::setLastModified(const QDateTime &lm) 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(); @@ -206,2 +213,6 @@ void IncidenceBase::setLastModified(const QDateTime &lm) } +QString IncidenceBase::lastModifiedSortKey() const +{ + return mLastModifiedKey; +} diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index 665c1f6..444d4c4 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h @@ -65,2 +65,3 @@ class IncidenceBase : public CustomProperties QDateTime lastModified() const; + QString lastModifiedSortKey() const; @@ -162,2 +163,3 @@ class IncidenceBase : public CustomProperties QString mOrganizer; + QString mLastModifiedKey; QString mUid; |