diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-02-21 21:31:31 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-10 09:25:57 -0700 |
commit | 028807ebc5085652c53f75c1419e9cca988cd0a9 (patch) | |
tree | e9c385ae929265f3afa02fa59f4d3b56fdc2a964 | |
parent | 9e13777cc1fde30d7cac03e59ddf3481bbc28eac (diff) | |
download | subsurface-028807ebc5085652c53f75c1419e9cca988cd0a9.tar.gz |
mobile models: add trip location and notes
First step towards making those accessible and then editable.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-models/divetripmodel.cpp | 2 | ||||
-rw-r--r-- | qt-models/mobilelistmodel.cpp | 2 | ||||
-rw-r--r-- | qt-models/mobilelistmodel.h | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index 1281ed84c..1eee924f8 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -103,6 +103,8 @@ QVariant DiveTripModelBase::tripData(const dive_trip *trip, int column, int role case MobileListModel::TripNrDivesRole: return trip->dives.nr; case MobileListModel::TripShortDateRole: return tripShortDate(trip); case MobileListModel::TripTitleRole: return tripTitle(trip); + case MobileListModel::TripLocationRole: return QString(trip->location); + case MobileListModel::TripNotesRole: return QString(trip->notes); } #endif diff --git a/qt-models/mobilelistmodel.cpp b/qt-models/mobilelistmodel.cpp index cbb6871b6..c98c37e6a 100644 --- a/qt-models/mobilelistmodel.cpp +++ b/qt-models/mobilelistmodel.cpp @@ -49,6 +49,8 @@ QHash<int, QByteArray> MobileListModelBase::roleNames() const roles[DiveInTripRole] = "diveInTrip"; roles[TripAbove] = "tripAbove"; roles[TripBelow] = "tripBelow"; + roles[TripLocationRole] = "tripLocation"; + roles[TripNotesRole] = "tripNotes"; return roles; } diff --git a/qt-models/mobilelistmodel.h b/qt-models/mobilelistmodel.h index d00f26c62..c289684bd 100644 --- a/qt-models/mobilelistmodel.h +++ b/qt-models/mobilelistmodel.h @@ -57,6 +57,8 @@ public: DiveInTripRole, TripAbove, TripBelow, + TripLocationRole, + TripNotesRole, }; QHash<int, QByteArray> roleNames() const override; protected: |