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>
This commit is contained in:
Dirk Hohndel 2015-12-26 13:19:43 -08:00
parent 07a0ef2139
commit 7ffe7a8c8a
4 changed files with 21 additions and 0 deletions

View file

@ -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";

View file

@ -26,6 +26,7 @@ public:
DiveGasRole,
DiveSacRole,
DiveLocationRole,
DiveGPSRole,
DiveNotesRole,
DiveBuddyRole,
DiveMasterRole,