mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
mobile/models: add access to tags string
We already allow filtering by tags, but don't even show them on mobile. That seems rather inconsistent. First step is to make the tags available to the QML layer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6f96edd766
commit
4db79c8db9
3 changed files with 3 additions and 0 deletions
|
@ -222,6 +222,7 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
|
|||
case MobileListModel::SumWeightRole: return get_weight_string(weight_t { total_weight(d) }, true);
|
||||
case MobileListModel::DiveMasterRole: return d->divemaster ? d->divemaster : QString();
|
||||
case MobileListModel::BuddyRole: return d->buddy ? d->buddy : QString();
|
||||
case MobileListModel::TagsRole: return get_taglist_string(d->tag_list);
|
||||
case MobileListModel::NotesRole: return formatNotes(d);
|
||||
case MobileListModel::GpsRole: return d->dive_site ? printGPSCoords(&d->dive_site->location) : QString();
|
||||
case MobileListModel::GpsDecimalRole: return format_gps_decimal(d);
|
||||
|
|
|
@ -33,6 +33,7 @@ QHash<int, QByteArray> MobileListModelBase::roleNames() const
|
|||
roles[SumWeightRole] = "sumWeight";
|
||||
roles[DiveMasterRole] = "diveMaster";
|
||||
roles[BuddyRole] = "buddy";
|
||||
roles[TagsRole] = "tags";
|
||||
roles[NotesRole]= "notes";
|
||||
roles[GpsRole] = "gps";
|
||||
roles[GpsDecimalRole] = "gpsDecimal";
|
||||
|
|
|
@ -41,6 +41,7 @@ public:
|
|||
SumWeightRole,
|
||||
DiveMasterRole,
|
||||
BuddyRole,
|
||||
TagsRole,
|
||||
NotesRole,
|
||||
GpsDecimalRole,
|
||||
GpsRole,
|
||||
|
|
Loading…
Reference in a new issue