From af1eff03c9e839914aab4109970c4a9f6fac8a99 Mon Sep 17 00:00:00 2001 From: aqua Date: Thu, 8 Sep 2022 10:27:30 +0300 Subject: RekonqSettings: add resetValue and remove value's defaultValue parameter - generate default rekonqrc and include it in libsettings - Settings uses :/settings/rekonqrc to provide default values - Add Settings::path() to get the default settings location --- src/settings/settingswidget.cpp | 42 ----------------------------------------- 1 file changed, 42 deletions(-) (limited to 'src/settings/settingswidget.cpp') diff --git a/src/settings/settingswidget.cpp b/src/settings/settingswidget.cpp index b5a2432c..60f2bf62 100644 --- a/src/settings/settingswidget.cpp +++ b/src/settings/settingswidget.cpp @@ -37,45 +37,3 @@ void SettingsWidget::save() if (objectName() != QLatin1String("General")) m_settings->endGroup(); } - -void SettingsWidget::reset() -{ - if (objectName() != QLatin1String("General")) m_settings->beginGroup(objectName()); - - // Int - for (auto *spinbox : findChildren(QString(), Qt::FindDirectChildrenOnly)) { - const auto value = spinbox->property("defaultValue"); - spinbox->setValue(value.toInt()); - m_settings->setValue(spinbox->objectName(), value); - } - - // Bool - for (auto *checkbox : findChildren(QString(), Qt::FindDirectChildrenOnly)) { - const auto value = checkbox->property("defaultValue"); - checkbox->setChecked(value.toBool()); - m_settings->setValue(checkbox->objectName(), value); - } - - // String - for (auto *lineedit : findChildren(QString(), Qt::FindDirectChildrenOnly)) { - const auto value = lineedit->property("defaultValue"); - lineedit->setText(value.toString()); - m_settings->setValue(lineedit->objectName(), value); - } - - // Font - for (auto *font : findChildren(QString(), Qt::FindDirectChildrenOnly)) { - const auto value = font->property("defaultValue"); - font->setFont(QFont(value.toString())); - m_settings->setValue(font->objectName(), value); - } - - // Shortcut - for (auto *shortcut : findChildren(QString(), Qt::FindDirectChildrenOnly)) { - const auto value = shortcut->property("defaultValue"); - shortcut->setKeySequence(value.toString()); - m_settings->setValue(shortcut->objectName(), value); - } - - if (objectName() != QLatin1String("General")) m_settings->endGroup(); -} \ No newline at end of file -- cgit v1.2.1