[partition] Refactor filling combobox with moint points

- Move to one place which handles the standard mount points
 - While here, introduce explicit "(no mount point)" string
   into the combo box. This is prep-work for issue #951.
This commit is contained in:
Adriaan de Groot 2018-05-15 05:40:52 -04:00
parent b5d667f76e
commit fda2e54e0f
5 changed files with 94 additions and 13 deletions

View file

@ -28,6 +28,7 @@
#include <core/PartitionInfo.h>
#include "core/PartUtils.h"
#include <core/KPMHelpers.h>
#include "gui/MountPoints.h"
#include <gui/PartitionSizeController.h>
#include <ui_EditExistingPartitionDialog.h>
@ -55,13 +56,7 @@ EditExistingPartitionDialog::EditExistingPartitionDialog( Device* device, Partit
, m_usedMountPoints( usedMountPoints )
{
m_ui->setupUi( this );
QStringList mountPoints = { "/", "/boot", "/home", "/opt", "/usr", "/var" };
if ( PartUtils::isEfiSystem() )
mountPoints << Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString();
mountPoints.removeDuplicates();
mountPoints.sort();
m_ui->mountPointComboBox->addItems( mountPoints );
standardMountPoints( *(m_ui->mountPointComboBox) );
QColor color = ColorUtils::colorForPartition( m_partition );
m_partitionSizeController->init( m_device, m_partition, color );