summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-07 22:37:31 -0500
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-13 11:32:27 -0700
commit9a73be92077614e290a4ce08d237112e5a22b6b1 (patch)
tree60ff0ff7cb3160422d86b1ca77da7ce054c06174 /mobile-widgets/qmlmanager.cpp
parent2f0689d3b82f4e3db4e456b26e3dba299cfa18e4 (diff)
downloadsubsurface-9a73be92077614e290a4ce08d237112e5a22b6b1.tar.gz
Mobile: add helper function to keep selection in sync
Without this the core data structure never gets updated to reflect which dive is currently selected. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index f6c182a55..08ce7fca7 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1375,6 +1375,15 @@ bool QMLManager::undoDelete(int id)
return true;
}
+void QMLManager::selectDive(int id)
+{
+ int i;
+ struct dive *dive = NULL;
+
+ for_each_dive (i, dive)
+ dive->selected = (dive->id == id);
+}
+
void QMLManager::deleteDive(int id)
{
struct dive *d = get_dive_by_uniq_id(id);