From 448e478b6d4afc50fbb040196483581a68875bb6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 12 Mar 2021 13:54:06 +0100 Subject: [PATCH] [users] Use base Config and its Preset-handling --- src/modules/users/Config.cpp | 11 ++++++----- src/modules/users/Config.h | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/modules/users/Config.cpp b/src/modules/users/Config.cpp index 00aa257fa..0fcf745fa 100644 --- a/src/modules/users/Config.cpp +++ b/src/modules/users/Config.cpp @@ -16,7 +16,6 @@ #include "GlobalStorage.h" #include "JobQueue.h" -#include "modulesystem/Preset.h" #include "utils/Logger.h" #include "utils/String.h" #include "utils/Variant.h" @@ -92,7 +91,7 @@ hostNameActionNames() } Config::Config( QObject* parent ) - : QObject( parent ) + : Calamares::ModuleSystem::Config( parent ) { emit readyChanged( m_isReady ); // false @@ -838,9 +837,11 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) updateGSAutoLogin( doAutoLogin(), loginName() ); checkReady(); - bool bogus = true; - Calamares::ModuleSystem::Presets p( CalamaresUtils::getSubMap( configurationMap, "presets", bogus ), - { "fullname", "loginname", } ); + loadPresets( configurationMap, + { + "fullname", + "loginname", + } ); } void diff --git a/src/modules/users/Config.h b/src/modules/users/Config.h index d4bfee4a4..28f0c73d7 100644 --- a/src/modules/users/Config.h +++ b/src/modules/users/Config.h @@ -13,6 +13,7 @@ #include "CheckPWQuality.h" #include "Job.h" +#include "modulesystem/Config.h" #include "utils/NamedEnum.h" #include @@ -85,7 +86,7 @@ private: }; -class PLUGINDLLEXPORT Config : public QObject +class PLUGINDLLEXPORT Config : public Calamares::ModuleSystem::Config { Q_OBJECT @@ -161,7 +162,7 @@ public: Config( QObject* parent = nullptr ); ~Config() override; - void setConfigurationMap( const QVariantMap& ); + void setConfigurationMap( const QVariantMap& ) override; /** @brief Fill Global Storage with some settings *