aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-03 05:06:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-08 20:50:05 +0100
commitccace53b83f753c8ce20a8a004a5645baeff58b2 (patch)
tree0c65b0bfa8723fac980b85ea97d05a7e5ba18588 /mobile-widgets
parent08e2013d1e10845ed15ed62709580128ff65e1eb (diff)
downloadsubsurface-ccace53b83f753c8ce20a8a004a5645baeff58b2.tar.gz
Mobile: remember if we were able to open the local cache
If there is a local cache, we at least once successfully accessed the cloud, so this is a valid cloud based git tree. Without this change we run into a subtle bug: after a fresh install, or when switching users, when the cloud data is accessed the very first time, we don't remember that this was indeed loaded from the cloud. So if we then download from a dive computer or make any other changes to the dive log, we cannot save those dives to cloud storage - but we fail silently doing so. Which to the user would look that inexplicable data loss. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 1aadc6b50..983f192be 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -302,6 +302,9 @@ void QMLManager::openLocalThenRemote(QString url)
QMLPrefs::instance()->setCredentialStatus(qPrefCloudStorage::CS_NEED_TO_VERIFY);
} else {
// if we can load from the cache, we know that we have a valid cloud account
+ // and we know that there was at least one successful sync with the cloud when
+ // that local cache was created - so there is a common ancestor
+ setLoadFromCloud(true);
if (QMLPrefs::instance()->credentialStatus() == qPrefCloudStorage::CS_UNKNOWN)
QMLPrefs::instance()->setCredentialStatus(qPrefCloudStorage::CS_VERIFIED);
if (git_prefs.unit_system == IMPERIAL)