summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--mobile-widgets/qmlmanager.cpp2
-rw-r--r--qt-models/divetripmodel.cpp7
3 files changed, 5 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 70f19c881..7173d5006 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-
+mobile: fix manually adding dives in the past [#2971]
---
* Always add new entries at the very top of this file above other existing entries and this note.
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 140a64777..648532d7d 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1414,7 +1414,7 @@ void QMLManager::selectDive(int id)
amount_selected++;
}
if (amount_selected == 0)
- qWarning("QManager::selectDive() called with unknown id");
+ qWarning("QManager::selectDive() called with unknown id %d",id);
}
void QMLManager::deleteDive(int id)
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);