do not use Global Storage for variable PreCheckEncryption, other modules

don't have to know if this variable is set to true or false
This commit is contained in:
Penvern Vincent 2024-04-15 16:34:35 +02:00
parent 70a59d6cd1
commit cc835cee6f
4 changed files with 11 additions and 4 deletions

View File

@ -444,6 +444,7 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
m_allowZfsEncryption = Calamares::getBool( configurationMap, "allowZfsEncryption", true );
m_allowManualPartitioning = Calamares::getBool( configurationMap, "allowManualPartitioning", true );
m_preCheckEncryption = Calamares::getBool( configurationMap, "preCheckEncryption", false );
m_showNotEncryptedBootMessage = Calamares::getBool( configurationMap, "showNotEncryptedBootMessage", true );
m_requiredPartitionTableType = Calamares::getStringList( configurationMap, "requiredPartitionTableType" );

View File

@ -35,7 +35,7 @@ class Config : public QObject
replaceModeFilesystemChanged )
Q_PROPERTY( bool allowManualPartitioning READ allowManualPartitioning CONSTANT FINAL )
Q_PROPERTY( bool preCheckEncryption READ preCheckEncryption CONSTANT FINAL )
Q_PROPERTY( bool showNotEncryptedBootMessage READ showNotEncryptedBootMessage CONSTANT FINAL )
public:
@ -148,6 +148,13 @@ public:
/// @brief Is manual partitioning allowed (not explicitly disabled in the config file)?
bool allowManualPartitioning() const { return m_allowManualPartitioning; }
/** @brief pre check encryption checkbox.
*
* parameter is used if enableLuksAutomatedPartitioning is true.
* Default value is false
*/
bool preCheckEncryption() const { return m_preCheckEncryption; }
/// @brief Show "Boot partition not encrypted" warning (not explicitly disabled in the config file)?
bool showNotEncryptedBootMessage() const { return m_showNotEncryptedBootMessage; }
@ -199,6 +206,7 @@ private:
QStringList m_requiredPartitionTableType;
bool m_allowZfsEncryption = true;
bool m_allowManualPartitioning = true;
bool m_preCheckEncryption = false;
bool m_showNotEncryptedBootMessage = true;
};

View File

@ -698,8 +698,6 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
Calamares::getBool( configurationMap, "alwaysShowPartitionLabels", true ) );
gs->insert( "enableLuksAutomatedPartitioning",
Calamares::getBool( configurationMap, "enableLuksAutomatedPartitioning", true ) );
gs->insert( "preCheckEncryption",
Calamares::getBool( configurationMap, "preCheckEncryption", false ) );
QString partitionTableName = Calamares::getString( configurationMap, "defaultPartitionTableType" );
if ( partitionTableName.isEmpty() )

View File

@ -90,7 +90,7 @@ ChoicePage::ChoicePage( Config* config, QWidget* parent )
auto gs = Calamares::JobQueue::instance()->globalStorage();
m_enableEncryptionWidget = gs->value( "enableLuksAutomatedPartitioning" ).toBool();
m_preCheckEncryption = gs->value( "preCheckEncryption" ).toBool();
m_preCheckEncryption = m_config->preCheckEncryption();
// Set up drives combo
m_mainLayout->setDirection( QBoxLayout::TopToBottom );