summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2016-08-28 20:10:17 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-08-28 20:01:00 -0700
commite54f81855dc49e302e42e17538256fe738dba73f (patch)
tree46f7a339cdb70dd8ac51991eab14586efc3bdf4b /core
parent3d788414c730e45f04ae9d56c8d4afd6c06d0ea7 (diff)
downloadsubsurface-e54f81855dc49e302e42e17538256fe738dba73f.tar.gz
Settings update: Fix cloud_git_url
I was freeing data segment, sigh. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index edb5ad804..55670eb22 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -1089,9 +1089,15 @@ void CloudStorageSettings::setBaseUrl(const QString& value)
{
if (value == prefs.cloud_base_url)
return;
- qDebug() << prefs.cloud_base_url << prefs.cloud_git_url;
- free((void*)prefs.cloud_base_url);
- free((void*)prefs.cloud_git_url);
+
+ // dont free data segment.
+ if (prefs.cloud_base_url != default_prefs.cloud_base_url) {
+ free((void*)prefs.cloud_base_url);
+ free((void*)prefs.cloud_git_url);
+ }
+ QSettings s;
+ s.beginGroup(group);
+ s.setValue("cloud_base_url", value);
prefs.cloud_base_url = copy_string(qPrintable(value));
prefs.cloud_git_url = copy_string(qPrintable(QString(prefs.cloud_base_url) + "/git"));
}