aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/Wizard.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-15 17:02:40 +0000
committersaturneric <[email protected]>2024-01-15 17:02:40 +0000
commitd54f52ce70cba15f5199e93d3c6fb122143b0526 (patch)
treef75224f8d020c4c7498bd1ffb97c834e12ec8a2c /src/ui/dialog/Wizard.cpp
parentfix: clean up useless code and make life easier (diff)
downloadGpgFrontend-d54f52ce70cba15f5199e93d3c6fb122143b0526.tar.gz
GpgFrontend-d54f52ce70cba15f5199e93d3c6fb122143b0526.zip
refactor: remove libconfig++ form project
Diffstat (limited to 'src/ui/dialog/Wizard.cpp')
-rw-r--r--src/ui/dialog/Wizard.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/ui/dialog/Wizard.cpp b/src/ui/dialog/Wizard.cpp
index bdb7a669..65a5d822 100644
--- a/src/ui/dialog/Wizard.cpp
+++ b/src/ui/dialog/Wizard.cpp
@@ -48,8 +48,10 @@ Wizard::Wizard(QWidget* parent) : QWizard(parent) {
setPixmap(QWizard::LogoPixmap, QPixmap(":/logo_small.png"));
setPixmap(QWizard::BannerPixmap, QPixmap(":/banner.png"));
- int next_page_id = GlobalSettingStation::GetInstance().LookupSettings(
- "wizard.next_page", -1);
+ int next_page_id = GlobalSettingStation::GetInstance()
+ .GetSettings()
+ .value("wizard.next_page", -1)
+ .toInt();
setStartId(next_page_id);
connect(this, &Wizard::accepted, this, &Wizard::slot_wizard_accepted);
@@ -58,17 +60,8 @@ Wizard::Wizard(QWidget* parent) : QWizard(parent) {
void Wizard::slot_wizard_accepted() {
// Don't show is mapped to show -> negation
try {
- auto& settings = GlobalSettingStation::GetInstance().GetMainSettings();
- if (!settings.exists("wizard")) {
- settings.add("wizard", libconfig::Setting::TypeGroup);
- }
- auto& wizard = settings["wizard"];
- if (!wizard.exists("show_wizard")) {
- wizard.add("show_wizard", libconfig::Setting::TypeBoolean) = false;
- } else {
- wizard["show_wizard"] = false;
- }
- GlobalSettingStation::GetInstance().SyncSettings();
+ auto settings = GlobalSettingStation::GetInstance().GetSettings();
+ settings.setValue("wizard/show_wizard", false);
} catch (...) {
GF_UI_LOG_ERROR("setting operation error");
}