From 2dc14dae8ed60887075716a78b21e5a012a60b4f Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Sat, 21 Jan 2017 03:03:33 +0100 Subject: [PATCH] Do not write bootloader install path if the system is EFI. --- src/modules/partition/gui/PartitionPage.cpp | 8 +++++++- src/modules/partition/gui/PartitionPage.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/gui/PartitionPage.cpp b/src/modules/partition/gui/PartitionPage.cpp index a4dfad423..8f59c30c3 100644 --- a/src/modules/partition/gui/PartitionPage.cpp +++ b/src/modules/partition/gui/PartitionPage.cpp @@ -57,7 +57,10 @@ PartitionPage::PartitionPage( PartitionCoreModule* core, QWidget* parent ) , m_ui( new Ui_PartitionPage ) , m_lastSelectedBootLoaderIndex(-1) , m_core( core ) + , m_isEfi( false ) { + m_isEfi = QDir( "/sys/firmware/efi/efivars" ).exists(); + m_ui->setupUi( this ); m_ui->partitionLabelsView->setVisible( 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->deleteButton, &QAbstractButton::clicked, this, &PartitionPage::onDeleteClicked ); - if ( QDir( "/sys/firmware/efi/efivars" ).exists() ) { + if ( m_isEfi ) { m_ui->bootLoaderComboBox->hide(); m_ui->label_3->hide(); } @@ -301,6 +304,9 @@ PartitionPage::editExistingPartition( Device* device, Partition* partition ) void PartitionPage::updateBootLoaderInstallPath() { + if ( m_isEfi || !m_ui->bootLoaderComboBox->isVisible() ) + return; + QVariant var = m_ui->bootLoaderComboBox->currentData( BootLoaderModel::BootLoaderPathRole ); if ( !var.isValid() ) return; diff --git a/src/modules/partition/gui/PartitionPage.h b/src/modules/partition/gui/PartitionPage.h index 59453ce18..f998fe2ae 100644 --- a/src/modules/partition/gui/PartitionPage.h +++ b/src/modules/partition/gui/PartitionPage.h @@ -66,6 +66,7 @@ private: QMutex m_revertMutex; int m_lastSelectedBootLoaderIndex; + bool m_isEfi; }; #endif // PARTITIONPAGE_H