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>
This commit is contained in:
Dirk Hohndel 2016-01-10 21:40:03 -08:00
parent 60d5463311
commit a27d78af03

View file

@ -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;
}