summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences/preferences_language.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-08-15 11:50:53 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-15 16:11:39 -0700
commit6aee600aa7022dd8f0453c658c967d5268c611b3 (patch)
tree6c3547dc39c59d4cd79eb72adb45bc3e3760a58f /desktop-widgets/preferences/preferences_language.cpp
parent3b84dbe554a76e2f024b7254c079c761429223ac (diff)
downloadsubsurface-6aee600aa7022dd8f0453c658c967d5268c611b3.tar.gz
desktop-widgets/preferences: reemove SettingsObjectWrapper
remove use of SettingsObjectWrapper:: remove include of SettingsObjectWrapper.h use qPrefFoo:: for setters and getters replace prefs.foo with qPrefXYZ::foo() where feasible (this expands to the same code, but gives us more control over the variable). Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'desktop-widgets/preferences/preferences_language.cpp')
-rw-r--r--desktop-widgets/preferences/preferences_language.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/desktop-widgets/preferences/preferences_language.cpp b/desktop-widgets/preferences/preferences_language.cpp
index 2bcd3422d..76763be14 100644
--- a/desktop-widgets/preferences/preferences_language.cpp
+++ b/desktop-widgets/preferences/preferences_language.cpp
@@ -2,7 +2,7 @@
#include "preferences_language.h"
#include "ui_preferences_language.h"
#include "core/qthelper.h"
-#include "core/subsurface-qt/SettingsObjectWrapper.h"
+#include "core/settings/qPrefLanguage.h"
#include <QApplication>
#include <QMessageBox>
@@ -81,16 +81,14 @@ void PreferencesLanguage::syncSettings()
if (languages.count())
currentLocale = m->data(languages.first(),Qt::UserRole).toString();
-
- auto lang = qPrefLanguage::instance();
- lang->set_language(currentText);
- lang->set_lang_locale(currentLocale);
- lang->set_use_system_language(ui->languageSystemDefault->isChecked());
- lang->set_time_format_override(!ui->timeFormatSystemDefault->isChecked());
- lang->set_date_format_override(!ui->dateFormatSystemDefault->isChecked());
- lang->set_time_format(ui->timeFormatEntry->currentText());
- lang->set_date_format(ui->dateFormatEntry->currentText());
- lang->set_date_format_short(ui->shortDateFormatEntry->text());
+ qPrefLanguage::set_language(currentText);
+ qPrefLanguage::set_lang_locale(currentLocale);
+ qPrefLanguage::set_use_system_language(ui->languageSystemDefault->isChecked());
+ qPrefLanguage::set_time_format_override(!ui->timeFormatSystemDefault->isChecked());
+ qPrefLanguage::set_date_format_override(!ui->dateFormatSystemDefault->isChecked());
+ qPrefLanguage::set_time_format(ui->timeFormatEntry->currentText());
+ qPrefLanguage::set_date_format(ui->dateFormatEntry->currentText());
+ qPrefLanguage::set_date_format_short(ui->shortDateFormatEntry->text());
uiLanguage(NULL);
QString qDateTimeWeb = tr("These will be used as is. This might not be what you intended.\nSee http://doc.qt.io/qt-5/qdatetime.html#toString");