summaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/divetripmodel.cpp')
-rw-r--r--qt-models/divetripmodel.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 8671a62b6..789fb3b55 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -538,9 +538,6 @@ static ShownChange updateShownAll()
void DiveTripModelBase::currentChanged()
{
- if (oldCurrent == current_dive)
- return;
-
// On Desktop we use a signal to forward current-dive changed, on mobile we use ROLE_CURRENT.
// TODO: Unify - use the role for both.
#if defined(SUBSURFACE_MOBILE)
@@ -549,11 +546,13 @@ void DiveTripModelBase::currentChanged()
QModelIndex oldIdx = diveToIdx(oldCurrent);
dataChanged(oldIdx, oldIdx, roles);
}
- if (current_dive) {
+ if (current_dive && oldCurrent != current_dive) {
QModelIndex newIdx = diveToIdx(current_dive);
dataChanged(newIdx, newIdx, roles);
}
#else
+ if (oldCurrent == current_dive)
+ return;
if (current_dive) {
QModelIndex newIdx = diveToIdx(current_dive);
emit currentDiveChanged(newIdx);