Specify type when creating a new partition.
This commit is contained in:
parent
521d3efb39
commit
46946c7949
|
@ -119,11 +119,15 @@ bool NewOperation::canCreateNew(const Partition* p)
|
||||||
return p != NULL && p->roles().has(PartitionRole::Unallocated);
|
return p != NULL && p->roles().has(PartitionRole::Unallocated);
|
||||||
}
|
}
|
||||||
|
|
||||||
Partition* NewOperation::createNew(const Partition& cloneFrom)
|
Partition* NewOperation::createNew(const Partition& cloneFrom,
|
||||||
|
FileSystem::Type type)
|
||||||
{
|
{
|
||||||
Partition* p = new Partition(cloneFrom);
|
Partition* p = new Partition(cloneFrom);
|
||||||
|
|
||||||
p->deleteFileSystem();
|
p->deleteFileSystem();
|
||||||
|
p->setFileSystem(FileSystemFactory::create(type,
|
||||||
|
p->firstSector(),
|
||||||
|
p->lastSector()));
|
||||||
p->setState(Partition::StateNew);
|
p->setState(Partition::StateNew);
|
||||||
p->setPartitionPath(QString());
|
p->setPartitionPath(QString());
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#define NEWOPERATION__H
|
#define NEWOPERATION__H
|
||||||
|
|
||||||
|
#include "../fs/filesystem.h"
|
||||||
#include "../ops/operation.h"
|
#include "../ops/operation.h"
|
||||||
#include "../util/libpartitionmanagerexport.h"
|
#include "../util/libpartitionmanagerexport.h"
|
||||||
|
|
||||||
|
@ -60,7 +61,8 @@ class LIBKPMCORE_EXPORT NewOperation : public Operation
|
||||||
virtual bool targets(const Partition& p) const;
|
virtual bool targets(const Partition& p) const;
|
||||||
|
|
||||||
static bool canCreateNew(const Partition* p);
|
static bool canCreateNew(const Partition* p);
|
||||||
static Partition* createNew(const Partition& cloneFrom);
|
static Partition* createNew(const Partition& cloneFrom,
|
||||||
|
FileSystem::Type type);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Partition& newPartition() { return *m_NewPartition; }
|
Partition& newPartition() { return *m_NewPartition; }
|
||||||
|
|
Loading…
Reference in New Issue