summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-01-12 08:40:20 +0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-06 13:46:41 -0800
commita88ab64cf80db7bde3e14ac41acf1ed2d73dbdf1 (patch)
treec51b8dbae26a67d0bcdb5fefa14fedec8e887bb7
parent97e26fd51b5e235d0e60aeac4252f0b1bb0d1dff (diff)
downloadsubsurface-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.cpp2
-rw-r--r--qt-models/divetripmodel.h3
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,