Do not write bootloader install path if the system is EFI.

This commit is contained in:
Bernhard Landauer 2017-01-21 03:03:33 +01:00
parent 554ebcdff4
commit 2dc14dae8e
2 changed files with 8 additions and 1 deletions

View File

@ -57,7 +57,10 @@ PartitionPage::PartitionPage( PartitionCoreModule* core, QWidget* parent )
, m_ui( new Ui_PartitionPage ) , m_ui( new Ui_PartitionPage )
, m_lastSelectedBootLoaderIndex(-1) , m_lastSelectedBootLoaderIndex(-1)
, m_core( core ) , m_core( core )
, m_isEfi( false )
{ {
m_isEfi = QDir( "/sys/firmware/efi/efivars" ).exists();
m_ui->setupUi( this ); m_ui->setupUi( this );
m_ui->partitionLabelsView->setVisible( m_ui->partitionLabelsView->setVisible(
Calamares::JobQueue::instance()->globalStorage()-> Calamares::JobQueue::instance()->globalStorage()->
@ -100,7 +103,7 @@ PartitionPage::PartitionPage( PartitionCoreModule* core, QWidget* parent )
connect( m_ui->editButton, &QAbstractButton::clicked, this, &PartitionPage::onEditClicked ); connect( m_ui->editButton, &QAbstractButton::clicked, this, &PartitionPage::onEditClicked );
connect( m_ui->deleteButton, &QAbstractButton::clicked, this, &PartitionPage::onDeleteClicked ); connect( m_ui->deleteButton, &QAbstractButton::clicked, this, &PartitionPage::onDeleteClicked );
if ( QDir( "/sys/firmware/efi/efivars" ).exists() ) { if ( m_isEfi ) {
m_ui->bootLoaderComboBox->hide(); m_ui->bootLoaderComboBox->hide();
m_ui->label_3->hide(); m_ui->label_3->hide();
} }
@ -301,6 +304,9 @@ PartitionPage::editExistingPartition( Device* device, Partition* partition )
void void
PartitionPage::updateBootLoaderInstallPath() PartitionPage::updateBootLoaderInstallPath()
{ {
if ( m_isEfi || !m_ui->bootLoaderComboBox->isVisible() )
return;
QVariant var = m_ui->bootLoaderComboBox->currentData( BootLoaderModel::BootLoaderPathRole ); QVariant var = m_ui->bootLoaderComboBox->currentData( BootLoaderModel::BootLoaderPathRole );
if ( !var.isValid() ) if ( !var.isValid() )
return; return;

View File

@ -66,6 +66,7 @@ private:
QMutex m_revertMutex; QMutex m_revertMutex;
int m_lastSelectedBootLoaderIndex; int m_lastSelectedBootLoaderIndex;
bool m_isEfi;
}; };
#endif // PARTITIONPAGE_H #endif // PARTITIONPAGE_H