Revert "Trying out something really horrible."
This reverts commit 10d622b0339697c57d4072b34052e657136145a5.
This commit is contained in:
parent
bd573233ec
commit
16d10afcde
@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <kpmcore/core/device.h>
|
#include <kpmcore/core/device.h>
|
||||||
#include <kpmcore/core/partition.h>
|
#include <kpmcore/core/partition.h>
|
||||||
#include <kpmcore/fs/filesystemfactory.h>
|
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@ -202,15 +201,18 @@ void
|
|||||||
doReplacePartition( PartitionCoreModule* core, Device* dev, Partition* partition )
|
doReplacePartition( PartitionCoreModule* core, Device* dev, Partition* partition )
|
||||||
{
|
{
|
||||||
cDebug() << "doReplacePartition for device" << partition->partitionPath();
|
cDebug() << "doReplacePartition for device" << partition->partitionPath();
|
||||||
|
Partition* newPartition = KPMHelpers::createNewPartition(
|
||||||
|
partition->parent(),
|
||||||
|
*dev,
|
||||||
|
partition->roles(),
|
||||||
|
FileSystem::Ext4,
|
||||||
|
partition->firstSector(),
|
||||||
|
partition->lastSector() );
|
||||||
|
PartitionInfo::setMountPoint( newPartition, "/" );
|
||||||
|
PartitionInfo::setFormat( newPartition, true );
|
||||||
|
|
||||||
//HACK: setFileSystem is private in Partition for whatever reason, making the clone
|
core->deletePartition( dev, partition );
|
||||||
// with new type feature in FSF unusable outside Partition and friends.
|
core->createPartition( dev, newPartition );
|
||||||
// Dragons be here.
|
|
||||||
FileSystem* innerFs = (FileSystem*)( &( partition->fileSystem() ) );
|
|
||||||
innerFs = FileSystemFactory::cloneWithNewType( FileSystem::Ext4, partition->fileSystem() );
|
|
||||||
PartitionInfo::setMountPoint( partition, "/" );
|
|
||||||
PartitionInfo::setFormat( partition, true );
|
|
||||||
core->formatPartition( dev, partition );
|
|
||||||
|
|
||||||
core->dumpQueue();
|
core->dumpQueue();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user