summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/SettingsObjectWrapper.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2016-08-27 22:13:33 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-08-27 22:37:15 -0700
commit0a6f6b4382a35402cdfd792487a82c4e83b3a3b0 (patch)
tree21519e278df6586976900e10f37bb060a1d6f1f2 /core/subsurface-qt/SettingsObjectWrapper.cpp
parent270864d073359f783fbb9cbe17c583d6b88cb8ae (diff)
downloadsubsurface-0a6f6b4382a35402cdfd792487a82c4e83b3a3b0.tar.gz
Settings update: Fix missing groups and Language initialization
There's one function named uiLanguage() that should return the current uiLanguage() that subsurface is running, but it actually sets a whole lot of preferences, I think that the general idea of that function is okay, but it seems broken for me. still, I used it to load the correct language from the preferences since it's what this function is currently doing right now. Also, a lot of missing groups where added. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurface-qt/SettingsObjectWrapper.cpp')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index f3b156a27..64d4e27a6 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -1618,6 +1618,7 @@ void UnitsSettings::setCoordinatesTraditional(bool value)
if (value == prefs.coordinates_traditional)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("coordinates", value);
prefs.coordinates_traditional = value;
emit coordinatesTraditionalChanged(value);
@@ -1633,6 +1634,7 @@ void UnitsSettings::setUnitSystem(const QString& value)
return;
QSettings s;
+
s.setValue("unit_system", value);
if (value == QStringLiteral("metric")) {
@@ -1893,6 +1895,7 @@ void LanguageSettingsObjectWrapper::setUseSystemLanguage(bool value)
if (value == prefs.locale.use_system_language)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("UseSystemLanguage", value);
prefs.locale.use_system_language = copy_string(qPrintable(value));
emit useSystemLanguageChanged(value);
@@ -1903,6 +1906,7 @@ void LanguageSettingsObjectWrapper::setLanguage(const QString& value)
if (value == prefs.locale.language)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("UiLanguage", value);
prefs.locale.language = copy_string(qPrintable(value));
emit languageChanged(value);
@@ -1913,6 +1917,7 @@ void LanguageSettingsObjectWrapper::setTimeFormat(const QString& value)
if (value == prefs.time_format)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("time_format", value);
prefs.time_format = copy_string(qPrintable(value));;
emit timeFormatChanged(value);
@@ -1924,6 +1929,7 @@ void LanguageSettingsObjectWrapper::setDateFormat(const QString& value)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("date_format", value);
prefs.date_format = copy_string(qPrintable(value));;
emit dateFormatChanged(value);
@@ -1935,6 +1941,7 @@ void LanguageSettingsObjectWrapper::setDateFormatShort(const QString& value)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("date_format_short", value);
prefs.date_format_short = copy_string(qPrintable(value));;
emit dateFormatShortChanged(value);
@@ -1945,6 +1952,7 @@ void LanguageSettingsObjectWrapper::setTimeFormatOverride(bool value)
if (value == prefs.time_format_override)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("time_format_override", value);
prefs.time_format_override = value;
emit timeFormatOverrideChanged(value);
@@ -1956,6 +1964,7 @@ void LanguageSettingsObjectWrapper::setDateFormatOverride(bool value)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("date_format_override", value);
prefs.date_format_override = value;
emit dateFormatOverrideChanged(value);
@@ -1979,6 +1988,7 @@ void AnimationsSettingsObjectWrapper::setAnimationSpeed(int value)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("animation_speed", value);
prefs.animation_speed = value;
emit animationSpeedChanged(value);
@@ -2005,6 +2015,7 @@ void LocationServiceSettingsObjectWrapper::setDistanceThreshold(int value)
if (value == prefs.distance_threshold)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("distance_threshold", value);
prefs.distance_threshold = value;
emit distanceThresholdChanged(value);
@@ -2016,9 +2027,10 @@ void LocationServiceSettingsObjectWrapper::setTimeThreshold(int value)
return;
QSettings s;
+ s.beginGroup(group);
s.setValue("time_threshold", value);
prefs.time_threshold = value;
- emit timeThresholdChanged( value);
+ emit timeThresholdChanged(value);
}
SettingsObjectWrapper::SettingsObjectWrapper(QObject* parent):