From 028807ebc5085652c53f75c1419e9cca988cd0a9 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 21 Feb 2020 21:31:31 -0800 Subject: [PATCH] mobile models: add trip location and notes First step towards making those accessible and then editable. Signed-off-by: Dirk Hohndel --- qt-models/divetripmodel.cpp | 2 ++ qt-models/mobilelistmodel.cpp | 2 ++ qt-models/mobilelistmodel.h | 2 ++ 3 files changed, 6 insertions(+) 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 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 roleNames() const override; protected: