diff options
| author | 2020-01-12 08:40:20 +0800 | |
|---|---|---|
| committer | 2020-03-06 13:46:41 -0800 | |
| commit | a88ab64cf80db7bde3e14ac41acf1ed2d73dbdf1 (patch) | |
| tree | c51b8dbae26a67d0bcdb5fefa14fedec8e887bb7 | |
| 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>
| -rw-r--r-- | qt-models/divetripmodel.cpp | 2 | ||||
| -rw-r--r-- | qt-models/divetripmodel.h | 3 |
2 files changed, 4 insertions, 1 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(); } diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h index 39589a8e6..d0e473f7a 100644 --- a/qt-models/divetripmodel.h +++ b/qt-models/divetripmodel.h @@ -49,7 +49,8 @@ public: DIVE_ROLE, TRIP_ROLE, DIVE_IDX, - SELECTED_ROLE + SELECTED_ROLE, + CURRENT_ROLE }; enum Layout { TREE, |