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:
Dirk Hohndel 2020-05-11 07:13:01 -07:00
parent 6f96edd766
commit 4db79c8db9
3 changed files with 3 additions and 0 deletions

View file

@ -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);

View file

@ -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";

View file

@ -41,6 +41,7 @@ public:
SumWeightRole,
DiveMasterRole,
BuddyRole,
TagsRole,
NotesRole,
GpsDecimalRole,
GpsRole,