mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
core: add 'diveInTrip' role to underlying data model
This will allow us to offer differentiated options in the context menu. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
56db02a685
commit
968278fe91
3 changed files with 3 additions and 0 deletions
|
@ -229,6 +229,7 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
|
|||
case MobileListModel::EndPressureRole: return getEndPressure(d);
|
||||
case MobileListModel::FirstGasRole: return getFirstGas(d);
|
||||
case MobileListModel::SelectedRole: return d->selected;
|
||||
case MobileListModel::DiveInTripRole: return d->divetrip != NULL;
|
||||
}
|
||||
#endif
|
||||
switch (role) {
|
||||
|
|
|
@ -46,6 +46,7 @@ QHash<int, QByteArray> MobileListModelBase::roleNames() const
|
|||
roles[EndPressureRole] = "endPressure";
|
||||
roles[FirstGasRole] = "firstGas";
|
||||
roles[SelectedRole] = "selected";
|
||||
roles[DiveInTripRole] = "diveInTrip";
|
||||
return roles;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
EndPressureRole,
|
||||
FirstGasRole,
|
||||
SelectedRole,
|
||||
DiveInTripRole,
|
||||
};
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue