From c7c4e52849954958787ade216e5e1e1c39839c9f Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Mon, 14 Jul 2014 18:10:48 +0200 Subject: [PATCH] Load additional module-specific configuration into a Module object. --- src/libcalamaresui/modulesystem/Module.cpp | 6 ++++++ src/libcalamaresui/modulesystem/Module.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/libcalamaresui/modulesystem/Module.cpp b/src/libcalamaresui/modulesystem/Module.cpp index 6116f24e1..324a26203 100644 --- a/src/libcalamaresui/modulesystem/Module.cpp +++ b/src/libcalamaresui/modulesystem/Module.cpp @@ -51,6 +51,12 @@ operator>>( const YAML::Node& node, Calamares::Module* m ) { node[ "requires" ] >> m->m_requiredModules; } + + // Module-specific configuration + if ( node[ "configuration" ] && node[ "configuration" ].IsMap() ) + { + m->m_configurationMap = CalamaresUtils::yamlMapToVariant( node[ "configuration" ] ).toMap(); + } } namespace Calamares diff --git a/src/libcalamaresui/modulesystem/Module.h b/src/libcalamaresui/modulesystem/Module.h index 8d53558a5..bcf548f54 100644 --- a/src/libcalamaresui/modulesystem/Module.h +++ b/src/libcalamaresui/modulesystem/Module.h @@ -22,6 +22,7 @@ #include "UiDllMacro.h" #include +#include namespace YAML @@ -79,6 +80,7 @@ private: Interface m_interface; QStringList m_requiredModules; QString m_directory; + QVariantMap m_configurationMap; friend void ::operator>>( const YAML::Node& node, Calamares::Module* m ); };