aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-03 15:23:20 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-04-04 12:00:25 -0700
commite43362fdcfb60d5f5b714ec473a193f6b5aa5fe5 (patch)
tree8015658790b9b5f53261fcd1ab368fd8720cb137
parent35080aad98698b6de5f1810a421514648ec6db65 (diff)
downloadsubsurface-e43362fdcfb60d5f5b714ec473a193f6b5aa5fe5.tar.gz
mobile/download-from-DC: ensure that changes get actually saved
Calling saveChangesLocal() seems like the right thing to do, but it doesn't do anything useful if the dive list hasn't been marked as changed. The correct helper function to call is changesNeedSaving() which makes sure we save the changes and update all UI information. [Berthold: since this removes the last QML caller of saveChangesLocal() we can make that function private.] Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml2
-rw-r--r--mobile-widgets/qmlmanager.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml
index 5b5220704..e16fbc2db 100644
--- a/mobile-widgets/qml/DownloadFromDiveComputer.qml
+++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml
@@ -467,7 +467,7 @@ Kirigami.Page {
importModel.recordDives()
// it's important to save the changes because the app could get killed once
// it's in the background - and the freshly downloaded dives would get lost
- manager.saveChangesLocal()
+ manager.changesNeedSaving()
pageStack.pop()
showDiveList()
download.text = qsTr("Download")
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index 8bfff476c..e37f1c474 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -186,7 +186,6 @@ public slots:
void addDiveToTrip(int id, int tripId);
void changesNeedSaving();
void openNoCloudRepo();
- void saveChangesLocal();
void saveChangesCloud(bool forceRemoteSync);
void selectDive(int id);
void deleteDive(int id);
@@ -277,6 +276,7 @@ private:
void consumeFinishedLoad();
void mergeLocalRepo();
void openLocalThenRemote(QString url);
+ void saveChangesLocal();
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
QString appLogFileName;