From 3248aba8995d0cb0aa455b1214f9645bd9814850 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 1 Apr 2019 06:26:42 -0400 Subject: [PATCH] [libcalamares] Make oem-setup independent of dont-chroot - At least for testing purposes it makes sense to decouple dont-chroot from the OEM-setup wording, so introduce a separate setting for it. --- src/libcalamares/Settings.cpp | 5 +++-- src/libcalamares/Settings.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libcalamares/Settings.cpp b/src/libcalamares/Settings.cpp index 9bedbbe41..9004cd8a2 100644 --- a/src/libcalamares/Settings.cpp +++ b/src/libcalamares/Settings.cpp @@ -35,7 +35,7 @@ hasValue( const YAML::Node& v ) return v.IsDefined() && !v.IsNull(); } -/** Helper function to grab a QString out of the config, and to warn if not present. */ +/** @brief Helper function to grab a QString out of the config, and to warn if not present. */ static QString requireString( const YAML::Node& config, const char* key ) { @@ -49,7 +49,7 @@ requireString( const YAML::Node& config, const char* key ) } } -/** Helper function to grab a bool out of the config, and to warn if not present. */ +/** @brief Helper function to grab a bool out of the config, and to warn if not present. */ static bool requireBool( const YAML::Node& config, const char* key, bool d ) { @@ -207,6 +207,7 @@ Settings::Settings( const QString& settingsFilePath, m_brandingComponentName = requireString( config, "branding" ); m_promptInstall = requireBool( config, "prompt-install", false ); m_doChroot = !requireBool( config, "dont-chroot", false ); + m_isSetupMode = requireBool( config, "oem-setup", !m_doChroot ); m_disableCancel = requireBool( config, "disable-cancel", false ); } catch ( YAML::Exception& e ) diff --git a/src/libcalamares/Settings.h b/src/libcalamares/Settings.h index c72e30421..0c0f0aa91 100644 --- a/src/libcalamares/Settings.h +++ b/src/libcalamares/Settings.h @@ -65,7 +65,7 @@ public: * NOTE: it's a synonym for !doChroot() for now, but may become * an independent setting. */ - bool isSetupMode() const { return !doChroot(); } + bool isSetupMode() const { return m_isSetupMode; } bool disableCancel() const; @@ -81,6 +81,7 @@ private: bool m_debug; bool m_doChroot; + bool m_isSetupMode; bool m_promptInstall; bool m_disableCancel; };