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>
This commit is contained in:
Tomaz Canabrava 2016-08-28 20:10:17 -03:00 committed by Dirk Hohndel
parent 3d788414c7
commit e54f81855d

View file

@ -1089,9 +1089,15 @@ void CloudStorageSettings::setBaseUrl(const QString& value)
{ {
if (value == prefs.cloud_base_url) if (value == prefs.cloud_base_url)
return; return;
qDebug() << prefs.cloud_base_url << prefs.cloud_git_url;
free((void*)prefs.cloud_base_url); // dont free data segment.
free((void*)prefs.cloud_git_url); 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_base_url = copy_string(qPrintable(value));
prefs.cloud_git_url = copy_string(qPrintable(QString(prefs.cloud_base_url) + "/git")); prefs.cloud_git_url = copy_string(qPrintable(QString(prefs.cloud_base_url) + "/git"));
} }