Merge pull request #2345 from calamares/fix-precheck-encryption

[partition] Fix crash on filesystem changes when encryption is checked
This commit is contained in:
Adriaan de Groot 2024-06-24 20:04:08 +02:00 committed by GitHub
commit a5a602c20e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 6 deletions

View File

@ -467,8 +467,6 @@ ChoicePage::onActionChanged()
{
m_encryptWidget->setFilesystem( FileSystem::typeForName( m_replaceFsTypesChoiceComboBox->currentText() ) );
}
m_encryptWidget->setEncryptionCheckbox( m_config->preCheckEncryption() );
}
Device* currd = selectedDevice();
@ -1035,6 +1033,10 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice )
if ( m_enableEncryptionWidget )
{
m_encryptWidget->show();
if ( m_config->preCheckEncryption() )
{
m_encryptWidget->setEncryptionCheckbox( true );
}
}
m_previewBeforeLabel->setText( tr( "Current:", "@label" ) );
m_selectLabel->setText( tr( "<strong>Select a partition to shrink, "
@ -1087,7 +1089,14 @@ ChoicePage::updateActionChoicePreview( InstallChoice choice )
case InstallChoice::Erase:
case InstallChoice::Replace:
{
m_encryptWidget->setVisible( shouldShowEncryptWidget( choice ) );
if ( shouldShowEncryptWidget( choice ) )
{
m_encryptWidget->show();
if ( m_config->preCheckEncryption() )
{
m_encryptWidget->setEncryptionCheckbox( true );
}
}
m_previewBeforeLabel->setText( tr( "Current:", "@label" ) );
m_afterPartitionBarsView = new PartitionBarsView( m_previewAfterFrame );
m_afterPartitionBarsView->setNestedPartitionsMode( mode );

View File

@ -182,11 +182,16 @@ EncryptWidget::updateState( const bool notify )
}
}
m_state = state();
Encryption newState = state();
if ( newState != m_state )
{
m_state = newState;
if ( notify )
{
Q_EMIT stateChanged( m_state );
}
}
}
void