summaryrefslogtreecommitdiffstats
path: root/qt-models/divelistmodel.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-24 11:17:48 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-24 11:17:48 -0700
commit7e7dcb2451e02a3c9dc0c314feeef9a68c625b5a (patch)
tree93f4980c0aa434d3b3d42ff7a99c6ab9cd1be0ad /qt-models/divelistmodel.h
parent0029844b1c889a88b4f5785426f4aad4caddc4f9 (diff)
downloadsubsurface-7e7dcb2451e02a3c9dc0c314feeef9a68c625b5a.tar.gz
QML UI: sort by date, not by date string
Just a quick bit of cleanup to separate date (the sortable, numeric value) from the date string that we want to display (but not sort by). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/divelistmodel.h')
-rw-r--r--qt-models/divelistmodel.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h
index 89f793bbc..de96480bd 100644
--- a/qt-models/divelistmodel.h
+++ b/qt-models/divelistmodel.h
@@ -8,8 +8,11 @@ class MobileDive {
public:
MobileDive(dive* d);
- QString date() const;
- void setDate(const QString &date);
+ QString dateString() const;
+ void setDateString(const QString &date);
+
+ timestamp_t date() const;
+ void setDate(const timestamp_t when);
QString location() const;
void setLocation(const QString &location);
@@ -70,7 +73,8 @@ private:
QString m_diveNumber;
QString m_trip;
- QString m_date;
+ timestamp_t m_date;
+ QString m_dateString;
QString m_rating;
QString m_depth;
QString m_duration;
@@ -100,6 +104,7 @@ public:
DiveNumberRole = Qt::UserRole + 1,
DiveTripRole,
DiveDateRole,
+ DiveDateStringRole,
DiveRatingRole,
DiveDepthRole,
DiveDurationRole,