diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 8c86dfa13..f8ac0bde9 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -851,6 +851,18 @@ ChoicePage::setupActions() else m_deviceInfoWidget->setPartitionTableType( PartitionTable::unknownTableType ); + bool atLeastOneCanBeResized = false; + + for ( auto it = PartitionIterator::begin( currentDevice ); + it != PartitionIterator::end( currentDevice ); ++it ) + { + if ( PartUtils::canBeResized( *it ) ) + { + atLeastOneCanBeResized = true; + break; + } + } + if ( osproberEntriesForCurrentDevice.count() == 0 ) { CALAMARES_RETRANSLATE( @@ -926,7 +938,7 @@ ChoicePage::setupActions() m_replaceButton->show(); - if ( osproberEntriesForCurrentDevice.first().canBeResized ) + if ( atLeastOneCanBeResized ) m_alongsideButton->show(); else { @@ -940,18 +952,6 @@ ChoicePage::setupActions() { // osproberEntriesForCurrentDevice has at least 2 items. - bool atLeastOneCanBeResized = false; - - for ( auto it = PartitionIterator::begin( currentDevice ); - it != PartitionIterator::end( currentDevice ); ++it ) - { - if ( PartUtils::canBeResized( *it ) ) - { - atLeastOneCanBeResized = true; - break; - } - } - CALAMARES_RETRANSLATE( m_messageLabel->setText( tr( "This storage device has multiple operating systems on it. " "What would you like to do?
"