[partition] Apply partition layout when replacing free space

When chosing the "Replace partition" option, free space is not handled
like any partition. In order to apply the custom partition layout in
that case too, we have to modify the code where "replace free space" is
handled.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
main
Arnaud Ferraris 6 years ago
parent ba673b17ee
commit fcd0e8d362

@ -745,37 +745,10 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
}
}
Partition* newPartition = nullptr;
if ( m_encryptWidget->state() == EncryptWidget::EncryptionConfirmed )
{
newPartition = KPMHelpers::createNewEncryptedPartition(
newParent,
*selectedDevice(),
newRoles,
FileSystem::typeForName( m_defaultFsType ),
selectedPartition->firstSector(),
selectedPartition->lastSector(),
m_encryptWidget->passphrase(),
PartitionTable::FlagNone
);
}
else
{
newPartition = KPMHelpers::createNewPartition(
newParent,
*selectedDevice(),
newRoles,
FileSystem::typeForName( m_defaultFsType ),
selectedPartition->firstSector(),
selectedPartition->lastSector(),
PartitionTable::FlagNone
);
}
PartitionInfo::setMountPoint( newPartition, "/" );
PartitionInfo::setFormat( newPartition, true );
m_core->createPartition( selectedDevice(), newPartition);
m_core->layoutApply( selectedDevice(), selectedPartition->firstSector(),
selectedPartition->lastSector(),
m_encryptWidget->passphrase(), newParent, newRoles
);
}
else
{

Loading…
Cancel
Save