mobile models: add trip location and notes

First step towards making those accessible and then editable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-02-21 21:31:31 -08:00
parent 9e13777cc1
commit 028807ebc5
3 changed files with 6 additions and 0 deletions

View file

@ -103,6 +103,8 @@ QVariant DiveTripModelBase::tripData(const dive_trip *trip, int column, int role
case MobileListModel::TripNrDivesRole: return trip->dives.nr; case MobileListModel::TripNrDivesRole: return trip->dives.nr;
case MobileListModel::TripShortDateRole: return tripShortDate(trip); case MobileListModel::TripShortDateRole: return tripShortDate(trip);
case MobileListModel::TripTitleRole: return tripTitle(trip); case MobileListModel::TripTitleRole: return tripTitle(trip);
case MobileListModel::TripLocationRole: return QString(trip->location);
case MobileListModel::TripNotesRole: return QString(trip->notes);
} }
#endif #endif

View file

@ -49,6 +49,8 @@ QHash<int, QByteArray> MobileListModelBase::roleNames() const
roles[DiveInTripRole] = "diveInTrip"; roles[DiveInTripRole] = "diveInTrip";
roles[TripAbove] = "tripAbove"; roles[TripAbove] = "tripAbove";
roles[TripBelow] = "tripBelow"; roles[TripBelow] = "tripBelow";
roles[TripLocationRole] = "tripLocation";
roles[TripNotesRole] = "tripNotes";
return roles; return roles;
} }

View file

@ -57,6 +57,8 @@ public:
DiveInTripRole, DiveInTripRole,
TripAbove, TripAbove,
TripBelow, TripBelow,
TripLocationRole,
TripNotesRole,
}; };
QHash<int, QByteArray> roleNames() const override; QHash<int, QByteArray> roleNames() const override;
protected: protected: