summaryrefslogtreecommitdiffstats
path: root/core/settings/qPrefCloudStorage.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-07-26 18:26:17 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-27 12:23:09 -0700
commit037ee9994d038fab1c2dec6aa7c6fca1fdbc1893 (patch)
tree78bc8c6eff70af63e24856fe7ed5bd14c02117c7 /core/settings/qPrefCloudStorage.cpp
parent67a875ef81290fe49a0b25e174615942d8404bea (diff)
downloadsubsurface-037ee9994d038fab1c2dec6aa7c6fca1fdbc1893.tar.gz
core: fix qPrefCloudStorage to derive git_url
remove set_git_url and git_url_changed, because it is not possible to set git_url, this is done inderectly through set_base_url Update disk_base_url to generated git_url for both load/sync Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/settings/qPrefCloudStorage.cpp')
-rw-r--r--core/settings/qPrefCloudStorage.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/core/settings/qPrefCloudStorage.cpp b/core/settings/qPrefCloudStorage.cpp
index 561554403..c3e9c60a7 100644
--- a/core/settings/qPrefCloudStorage.cpp
+++ b/core/settings/qPrefCloudStorage.cpp
@@ -17,7 +17,6 @@ qPrefCloudStorage *qPrefCloudStorage::instance()
void qPrefCloudStorage::loadSync(bool doSync)
{
disk_cloud_base_url(doSync);
- disk_cloud_git_url(doSync);
disk_cloud_storage_email(doSync);
disk_cloud_storage_email_encoded(doSync);
disk_cloud_storage_password(doSync);
@@ -41,28 +40,19 @@ void qPrefCloudStorage::set_cloud_base_url(const QString &value)
}
disk_cloud_base_url(true);
- disk_cloud_git_url(true);
emit cloud_base_url_changed(value);
- emit cloud_git_url_changed(valueGit);
}
}
-
-DISK_LOADSYNC_TXT(CloudStorage, "/cloud_base_url", cloud_base_url);
-
-void qPrefCloudStorage::set_cloud_git_url(const QString &value)
+void qPrefCloudStorage::disk_cloud_base_url(bool doSync)
{
- if (value != prefs.cloud_git_url) {
- // only free and set if not default
- if (prefs.cloud_git_url != default_prefs.cloud_git_url) {
- qPrefPrivate::copy_txt(&prefs.cloud_git_url, value);
- }
- disk_cloud_git_url(true);
- emit cloud_git_url_changed(value);
+ if (doSync) {
+ qPrefPrivate::instance()->setting.setValue(group + "/cloud_base_url", prefs.cloud_base_url);
+ } else {
+ prefs.cloud_base_url = copy_qstring(qPrefPrivate::instance()->setting.value(group + "/cloud_base_url", default_prefs.cloud_base_url).toString());
+ qPrefPrivate::copy_txt(&prefs.cloud_git_url, QString(prefs.cloud_base_url) + "/git");
}
}
-DISK_LOADSYNC_TXT(CloudStorage, "/cloud_git_url", cloud_git_url);
-
HANDLE_PREFERENCE_TXT(CloudStorage, "/email", cloud_storage_email);
HANDLE_PREFERENCE_TXT(CloudStorage, "/email_encoded", cloud_storage_email_encoded);