summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/gpslistmodel.cpp5
-rw-r--r--qt-models/gpslistmodel.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/qt-models/gpslistmodel.cpp b/qt-models/gpslistmodel.cpp
index 2c6fe6b5c..23349b00e 100644
--- a/qt-models/gpslistmodel.cpp
+++ b/qt-models/gpslistmodel.cpp
@@ -46,6 +46,8 @@ QVariant GpsListModel::data(const QModelIndex &index, int role) const
if (role == GpsDateRole)
return get_short_dive_date_string(gt.when);
+ else if (role == GpsWhenRole)
+ return gt.when;
else if (role == GpsNameRole)
return gt.name;
else if (role == GpsLatitudeRole)
@@ -58,7 +60,8 @@ QVariant GpsListModel::data(const QModelIndex &index, int role) const
QHash<int, QByteArray> GpsListModel::roleNames() const
{
QHash<int, QByteArray> roles;
- roles[GpsDateRole] = "when";
+ roles[GpsDateRole] = "date";
+ roles[GpsWhenRole] = "when";
roles[GpsNameRole] = "name";
roles[GpsLatitudeRole] = "latitude";
roles[GpsLongitudeRole] = "longitude";
diff --git a/qt-models/gpslistmodel.h b/qt-models/gpslistmodel.h
index 91a15540f..870540b4f 100644
--- a/qt-models/gpslistmodel.h
+++ b/qt-models/gpslistmodel.h
@@ -14,7 +14,8 @@ public:
GpsDateRole = Qt::UserRole + 1,
GpsNameRole,
GpsLatitudeRole,
- GpsLongitudeRole
+ GpsLongitudeRole,
+ GpsWhenRole
};
static GpsListModel *instance();