summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
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
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')
-rw-r--r--mobile-widgets/qmlmanager.cpp9
-rw-r--r--mobile-widgets/qmlmanager.h1
2 files changed, 10 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);
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index e47119a71..b2c118848 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -164,6 +164,7 @@ public slots:
void openNoCloudRepo();
void saveChangesLocal();
void saveChangesCloud(bool forceRemoteSync);
+ void selectDive(int id);
void deleteDive(int id);
void copyDiveData(int id);
void pasteDiveData(int id);