summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-10 21:40:03 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-10 21:40:03 -0800
commita27d78af03d3b622b32b3347daf7e727708b9f40 (patch)
treec0d2b104e075029e86d92a46f79a59bf576c6e1e
parent60d546331180df1b5cad61ce1646afdfb2ef522f (diff)
downloadsubsurface-a27d78af03d3b622b32b3347daf7e727708b9f40.tar.gz
Save a dive has to mean "save to local storage" on mobile
While it makes sense to have the concept of "what's in memory" and "what's on disk" in a desktop application, on a mobile device that seems like the wrong approach. If the user edits a dive and taps on "save", they reasonably expect this to be saved to storage (so our local cache of the remote git repository). And "Upload to cloud" then pushes the data to the cloud server. It may even be reasonable to do that automagically, but that I'm not so sure about. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-mobile/qmlmanager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index dd15f429d..79528cdff 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -471,6 +471,13 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location
if (diveChanged || needResort) {
refreshDiveList();
mark_divelist_changed(true);
+ // this is called "commit" for a reason - when the user saves an
+ // edit they have a reasonable expectation that their data is actually
+ // stored - so we need to store this to the local cache
+ qDebug() << "save dives to local cache";
+ prefs.cloud_background_sync = false;
+ saveChanges();
+ prefs.cloud_background_sync = true;
}
return notes;
}