From 60f8a7c5fb276cac4b9c802f5d3fcedb54e56668 Mon Sep 17 00:00:00 2001
From: Adriaan de Groot <groot@kde.org>
Date: Fri, 18 Jun 2021 22:20:11 +0200
Subject: [PATCH] [partition] Don't offer /boot if EFI wants something else

- Don't leave /boot in the list always; EFI might be configured
  for /boot/efi on this system
- While here, apply coding style.
---
 src/modules/partition/gui/PartitionDialogHelpers.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/modules/partition/gui/PartitionDialogHelpers.cpp b/src/modules/partition/gui/PartitionDialogHelpers.cpp
index c5c35279d4..0d25c3c8d2 100644
--- a/src/modules/partition/gui/PartitionDialogHelpers.cpp
+++ b/src/modules/partition/gui/PartitionDialogHelpers.cpp
@@ -23,11 +23,15 @@
 QStringList
 standardMountPoints()
 {
-    QStringList mountPoints { "/", "/boot", "/home", "/opt", "/srv", "/usr", "/var" };
+    QStringList mountPoints { "/", "/home", "/opt", "/srv", "/usr", "/var" };
     if ( PartUtils::isEfiSystem() )
     {
         mountPoints << Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString();
     }
+    else
+    {
+        mountPoints << QStringLiteral( "/boot" );
+    }
     mountPoints.removeDuplicates();
     mountPoints.sort();
     return mountPoints;
@@ -68,11 +72,13 @@ setSelectedMountPoint( QComboBox& combo, const QString& selected )
     else
     {
         for ( int i = 0; i < combo.count(); ++i )
+        {
             if ( selected == combo.itemText( i ) )
             {
                 combo.setCurrentIndex( i );
                 return;
             }
+        }
         combo.addItem( selected );
         combo.setCurrentIndex( combo.count() - 1 );
     }
@@ -85,10 +91,12 @@ flagsFromList( const QListWidget& list )
     PartitionTable::Flags flags;
 
     for ( int i = 0; i < list.count(); i++ )
+    {
         if ( list.item( i )->checkState() == Qt::Checked )
         {
             flags |= static_cast< PartitionTable::Flag >( list.item( i )->data( Qt::UserRole ).toInt() );
         }
+    }
 
     return flags;
 }
-- 
GitLab