From f4944408955918527cce1d39f9622aa0373cf5fa Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 29 Jun 2021 13:21:46 +0200 Subject: [PATCH] [partition] Don't run bool allowManualPartitioning through GS It's a bit over-wrought to store a bool in a QVariant in GS for consumption **only** by ChoicePage, so drop that GS key and store it locally. --- src/modules/partition/Config.cpp | 13 ++----------- src/modules/partition/Config.h | 7 ++++--- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/modules/partition/Config.cpp b/src/modules/partition/Config.cpp index a47bf90f8..deb75d2a4 100644 --- a/src/modules/partition/Config.cpp +++ b/src/modules/partition/Config.cpp @@ -220,14 +220,6 @@ Config::setEraseFsTypeChoice( const QString& choice ) } } - -bool -Config::allowManualPartitioning() const -{ - Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); - return gs->value( "allowManualPartitioning" ).toBool(); -} - static void fillGSConfigurationEFI( Calamares::GlobalStorage* gs, const QVariantMap& configurationMap ) { @@ -272,9 +264,7 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) } setSwapChoice( m_initialSwapChoice ); - Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); - gs->insert( "allowManualPartitioning", - CalamaresUtils::getBool( configurationMap, "allowManualPartitioning", true ) ); + m_allowManualPartitioning = CalamaresUtils::getBool( configurationMap, "allowManualPartitioning", true ); if ( configurationMap.contains( "availableFileSystemTypes" ) ) { @@ -288,6 +278,7 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) } } + Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); m_requiredPartitionTableType = CalamaresUtils::getStringList( configurationMap, "requiredPartitionTableType" ); gs->insert( "requiredPartitionTableType", m_requiredPartitionTableType ); diff --git a/src/modules/partition/Config.h b/src/modules/partition/Config.h index 826cc73b5..309bb4a49 100644 --- a/src/modules/partition/Config.h +++ b/src/modules/partition/Config.h @@ -112,9 +112,8 @@ public: QString eraseFsType() const { return m_eraseFsTypeChoice; } - - ///@brief Is manual partitioning allowed (not explicitly disnabled in the config file)? - bool allowManualPartitioning() const; + ///@brief Is manual partitioning allowed (not explicitly disabled in the config file)? + bool allowManualPartitioning() const { return m_allowManualPartitioning; } public Q_SLOTS: void setInstallChoice( int ); ///< Translates a button ID or so to InstallChoice @@ -138,6 +137,8 @@ private: InstallChoice m_installChoice = NoChoice; qreal m_requiredStorageGiB = 0.0; // May duplicate setting in the welcome module QStringList m_requiredPartitionTableType; + + bool m_allowManualPartitioning = true; }; /** @brief Given a set of swap choices, return a sensible value from it.