aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences/preferences_language.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/preferences/preferences_language.cpp')
-rw-r--r--desktop-widgets/preferences/preferences_language.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/desktop-widgets/preferences/preferences_language.cpp b/desktop-widgets/preferences/preferences_language.cpp
index 264e2a1a5..a1af676fa 100644
--- a/desktop-widgets/preferences/preferences_language.cpp
+++ b/desktop-widgets/preferences/preferences_language.cpp
@@ -30,19 +30,16 @@ PreferencesLanguage::~PreferencesLanguage()
void PreferencesLanguage::refreshSettings()
{
- QSettings s;
- s.beginGroup("Language");
- ui->languageSystemDefault->setChecked(s.value("UseSystemLanguage", true).toBool());
- ui->timeFormatSystemDefault->setChecked(!s.value("time_format_override", false).toBool());
- ui->dateFormatSystemDefault->setChecked(!s.value("date_format_override", false).toBool());
- ui->timeFormatEntry->setText(s.value("time_format").toString());
- ui->dateFormatEntry->setText(s.value("date_format").toString());
- ui->shortDateFormatEntry->setText(s.value("date_format_short").toString());
+ ui->languageSystemDefault->setChecked(prefs.locale.use_system_language);
+ ui->timeFormatSystemDefault->setChecked(!prefs.time_format_override);
+ ui->dateFormatSystemDefault->setChecked(!prefs.date_format_override);
+ ui->timeFormatEntry->setText(prefs.time_format);
+ ui->dateFormatEntry->setText(prefs.date_format);
+ ui->shortDateFormatEntry->setText(prefs.date_format_short);
QAbstractItemModel *m = ui->languageDropdown->model();
- QModelIndexList languages = m->match(m->index(0, 0), Qt::UserRole, s.value("UiLanguage").toString());
+ QModelIndexList languages = m->match(m->index(0, 0), Qt::UserRole, prefs.locale.language);
if (languages.count())
ui->languageDropdown->setCurrentIndex(languages.first().row());
- s.endGroup();
}
void PreferencesLanguage::syncSettings()