summaryrefslogtreecommitdiff
path: root/src/settings/settingswidget.cpp
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-09-08 10:27:30 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-09-08 16:33:03 +0300
commitaf1eff03c9e839914aab4109970c4a9f6fac8a99 (patch)
treeae11034560b0e1c270614077ffd8f0f7485c7381 /src/settings/settingswidget.cpp
parentAdd RekonqWindow tests (diff)
downloadrekonq-af1eff03c9e839914aab4109970c4a9f6fac8a99.tar.xz
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
Diffstat (limited to 'src/settings/settingswidget.cpp')
-rw-r--r--src/settings/settingswidget.cpp42
1 files changed, 0 insertions, 42 deletions
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<QSpinBox *>(QString(), Qt::FindDirectChildrenOnly)) {
- const auto value = spinbox->property("defaultValue");
- spinbox->setValue(value.toInt());
- m_settings->setValue(spinbox->objectName(), value);
- }
-
- // Bool
- for (auto *checkbox : findChildren<QCheckBox *>(QString(), Qt::FindDirectChildrenOnly)) {
- const auto value = checkbox->property("defaultValue");
- checkbox->setChecked(value.toBool());
- m_settings->setValue(checkbox->objectName(), value);
- }
-
- // String
- for (auto *lineedit : findChildren<QLineEdit *>(QString(), Qt::FindDirectChildrenOnly)) {
- const auto value = lineedit->property("defaultValue");
- lineedit->setText(value.toString());
- m_settings->setValue(lineedit->objectName(), value);
- }
-
- // Font
- for (auto *font : findChildren<QFontComboBox *>(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<QKeySequenceEdit *>(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