mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 02:15:36 -04:00
Move ReplacePartition operation to PartitionActions.
This commit is contained in:
parent
f267410dbb
commit
8a6dcfbe2f
3 changed files with 26 additions and 11 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "GlobalStorage.h"
|
||||
|
||||
#include <kpmcore/core/device.h>
|
||||
#include <kpmcore/core/partition.h>
|
||||
|
||||
#include <QDir>
|
||||
|
||||
|
@ -195,4 +196,25 @@ doAutopartition( PartitionCoreModule* core, Device* dev )
|
|||
core->dumpQueue();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
doReplacePartition( PartitionCoreModule* core, Device* dev, Partition* partition )
|
||||
{
|
||||
|
||||
Partition* newPartition = KPMHelpers::createNewPartition(
|
||||
partition->parent(),
|
||||
*dev,
|
||||
partition->roles(),
|
||||
FileSystem::Ext4,
|
||||
partition->firstSector(),
|
||||
partition->lastSector() );
|
||||
PartitionInfo::setMountPoint( newPartition, "/" );
|
||||
PartitionInfo::setFormat( newPartition, true );
|
||||
|
||||
core->deletePartition( dev, partition );
|
||||
core->createPartition( dev, newPartition );
|
||||
|
||||
core->dumpQueue();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue