diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-12-26 13:19:43 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-12-26 13:33:10 -0800 |
commit | 7ffe7a8c8a389fd56cba3c18d142bf1ad59d872c (patch) | |
tree | feaf6857c2c633ea7c733306a4cc8cc8265173cf /qt-models/divelistmodel.cpp | |
parent | 07a0ef213993b1dd04ace8ff3d8720a499570764 (diff) | |
download | subsurface-7ffe7a8c8a389fd56cba3c18d142bf1ad59d872c.tar.gz |
Dive list model: add GPS string access
If the QML UI needs the GPS information, we need a way to get to it.
I'm not convinced that having it as comma separated string is the best way to
go, but that's what I need for the Google API so that's what I picked for now.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/divelistmodel.cpp')
-rw-r--r-- | qt-models/divelistmodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp index ccd5b8afd..114cd6d1f 100644 --- a/qt-models/divelistmodel.cpp +++ b/qt-models/divelistmodel.cpp @@ -77,6 +77,8 @@ QVariant DiveListModel::data(const QModelIndex &index, int role) const return dive.sac(); else if (role == DiveLocationRole) return dive.location(); + else if (role == DiveGPSRole) + return dive.gps(); else if (role == DiveNotesRole) return dive.notes(); else if (role == DiveBuddyRole) @@ -107,6 +109,7 @@ QHash<int, QByteArray> DiveListModel::roleNames() const roles[DiveGasRole] = "gas"; roles[DiveSacRole] = "sac"; roles[DiveLocationRole] = "location"; + roles[DiveGPSRole] = "gps"; roles[DiveNotesRole] = "notes"; roles[DiveBuddyRole] = "buddy"; roles[DiveMasterRole] = "divemaster"; |