QML UI: keep cloud sync enabled state in settings

So if the app gets closed and restarted, it will continue to not sync (or
sync) over the network.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-04-03 18:48:20 -07:00
parent bb74144860
commit f7564c2b77
2 changed files with 5 additions and 0 deletions

View file

@ -1049,6 +1049,10 @@ void QMLManager::setSyncToCloud(bool status)
m_syncToCloud = status;
prefs.git_local_only = !status;
prefs.cloud_background_sync = status;
QSettings s;
s.beginGroup("CloudStorage");
s.setValue("git_local_only", prefs.git_local_only);
s.setValue("cloud_background_sync", prefs.cloud_background_sync);
emit syncToCloudChanged();
}

View file

@ -1491,6 +1491,7 @@ void loadPreferences()
}
GET_INT("cloud_verification_status", cloud_verification_status);
GET_BOOL("cloud_background_sync", cloud_background_sync);
GET_BOOL("git_local_only", git_local_only);
// creating the git url here is simply a convenience when C code wants
// to compare against that git URL - it's always derived from the base URL