[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

@ -23,6 +23,7 @@
#include "core/PartitionInfo.h"
#include "core/PartUtils.h"
#include "core/KPMHelpers.h"
#include "gui/MountPoints.h"
#include "gui/PartitionSizeController.h"
#include "ui_CreatePartitionDialog.h"
@ -81,12 +82,7 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device, PartitionNode* par
m_ui->lvNameLineEdit->setValidator(validator);
}
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) );
if ( device->partitionTable()->type() == PartitionTable::msdos ||
device->partitionTable()->type() == PartitionTable::msdos_sectorbased )