diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-01-12 08:40:20 +0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-06 13:46:41 -0800 |
commit | a88ab64cf80db7bde3e14ac41acf1ed2d73dbdf1 (patch) | |
tree | c51b8dbae26a67d0bcdb5fefa14fedec8e887bb7 /qt-models/divetripmodel.cpp | |
parent | 97e26fd51b5e235d0e60aeac4252f0b1bb0d1dff (diff) | |
download | subsurface-a88ab64cf80db7bde3e14ac41acf1ed2d73dbdf1.tar.gz |
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>
Diffstat (limited to 'qt-models/divetripmodel.cpp')
-rw-r--r-- | qt-models/divetripmodel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index ce4206cfb..5b7f96ba1 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -255,6 +255,8 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role) return get_divenr(d); case SELECTED_ROLE: return d->selected; + case CURRENT_ROLE: + return d == current_dive; } return QVariant(); } |