From 7ffe7a8c8a389fd56cba3c18d142bf1ad59d872c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 26 Dec 2015 13:19:43 -0800 Subject: 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 --- qt-models/divelistmodel.cpp | 3 +++ qt-models/divelistmodel.h | 1 + 2 files changed, 4 insertions(+) (limited to 'qt-models') 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 DiveListModel::roleNames() const roles[DiveGasRole] = "gas"; roles[DiveSacRole] = "sac"; roles[DiveLocationRole] = "location"; + roles[DiveGPSRole] = "gps"; roles[DiveNotesRole] = "notes"; roles[DiveBuddyRole] = "buddy"; roles[DiveMasterRole] = "divemaster"; diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h index a19d1b365..b75a0f182 100644 --- a/qt-models/divelistmodel.h +++ b/qt-models/divelistmodel.h @@ -26,6 +26,7 @@ public: DiveGasRole, DiveSacRole, DiveLocationRole, + DiveGPSRole, DiveNotesRole, DiveBuddyRole, DiveMasterRole, -- cgit v1.2.3-70-g09d2