Remove current partition's mountpoint from used list.

This means that when we edit a partition, we don't consider
its current mountpoint invalid because it is already in-use.

We need to do this for both "edit existing partition" and
"edit a partition that we are still creating".
main
shainer 8 years ago
parent 349470ae71
commit 2759529841

@ -62,8 +62,6 @@ EditExistingPartitionDialog::EditExistingPartitionDialog( Device* device, Partit
mountPoints.sort();
m_ui->mountPointComboBox->addItems( mountPoints );
m_usedMountPoints.removeOne( PartitionInfo::mountPoint( partition ) );
QColor color = ColorUtils::colorForPartition( m_partition );
m_partitionSizeController->init( m_device, m_partition, color );
m_partitionSizeController->setSpinBox( m_ui->sizeSpinBox );

@ -266,7 +266,10 @@ PartitionPage::onPartitionViewActivated()
void
PartitionPage::updatePartitionToCreate( Device* device, Partition* partition )
{
QPointer<CreatePartitionDialog> dlg = new CreatePartitionDialog( device, partition->parent(), getCurrentUsedMountpoints(), this );
QStringList mountPoints = getCurrentUsedMountpoints();
mountPoints.removeOne( PartitionInfo::mountPoint( partition ) );
QPointer<CreatePartitionDialog> dlg = new CreatePartitionDialog( device, partition->parent(), mountPoints, this );
dlg->initFromPartitionToCreate( partition );
if ( dlg->exec() == QDialog::Accepted )
{
@ -280,7 +283,10 @@ PartitionPage::updatePartitionToCreate( Device* device, Partition* partition )
void
PartitionPage::editExistingPartition( Device* device, Partition* partition )
{
QPointer<EditExistingPartitionDialog> dlg = new EditExistingPartitionDialog( device, partition, getCurrentUsedMountpoints(), this );
QStringList mountPoints = getCurrentUsedMountpoints();
mountPoints.removeOne( PartitionInfo::mountPoint( partition ) );
QPointer<EditExistingPartitionDialog> dlg = new EditExistingPartitionDialog( device, partition, mountPoints, this );
if ( dlg->exec() == QDialog::Accepted )
dlg->applyChanges( m_core );
delete dlg;

Loading…
Cancel
Save