divetripmodel: introduce CURRENT_ROLE

Use this role to test whether a dive is the currently displayed dive.
This will be needed to transport changes of the current dive to
the mobile list models.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-01-12 08:40:20 +08:00 committed by Dirk Hohndel
parent 97e26fd51b
commit a88ab64cf8
2 changed files with 4 additions and 1 deletions

View file

@ -255,6 +255,8 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
return get_divenr(d); return get_divenr(d);
case SELECTED_ROLE: case SELECTED_ROLE:
return d->selected; return d->selected;
case CURRENT_ROLE:
return d == current_dive;
} }
return QVariant(); return QVariant();
} }

View file

@ -49,7 +49,8 @@ public:
DIVE_ROLE, DIVE_ROLE,
TRIP_ROLE, TRIP_ROLE,
DIVE_IDX, DIVE_IDX,
SELECTED_ROLE SELECTED_ROLE,
CURRENT_ROLE
}; };
enum Layout { enum Layout {
TREE, TREE,