Delete partition table in LVM VG remove operation.
This commit is contained in:
parent
d6c375f959
commit
5c2d485b32
|
@ -47,16 +47,13 @@ QString DeactivateVolumeGroupOperation::description() const
|
|||
|
||||
void DeactivateVolumeGroupOperation::preview()
|
||||
{
|
||||
m_PartitionTable = device().partitionTable();
|
||||
device().setPartitionTable(new PartitionTable(PartitionTable::vmd, 0, device().totalLogical() - 1));
|
||||
}
|
||||
|
||||
void DeactivateVolumeGroupOperation::undo()
|
||||
{
|
||||
PartitionTable* tmp = device().partitionTable();
|
||||
if (tmp != partitionTable()) {
|
||||
device().setPartitionTable(partitionTable());
|
||||
delete tmp;
|
||||
}
|
||||
device().setPartitionTable(m_PartitionTable);
|
||||
}
|
||||
|
||||
/** loop through given device's partitions to check if any is mounted.
|
||||
|
|
|
@ -73,10 +73,6 @@ protected:
|
|||
return m_Device;
|
||||
}
|
||||
|
||||
PartitionTable* partitionTable() {
|
||||
return m_PartitionTable;
|
||||
}
|
||||
|
||||
private:
|
||||
DeactivateVolumeGroupJob* m_DeactivateVolumeGroupJob;
|
||||
DeactivateLogicalVolumeJob* m_DeactivateLogicalVolumeJob;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "ops/removevolumegroupoperation.h"
|
||||
#include "jobs/removevolumegroupjob.h"
|
||||
|
||||
#include "core/partitiontable.h"
|
||||
#include "core/volumemanagerdevice.h"
|
||||
|
||||
#include <QString>
|
||||
|
@ -41,8 +42,11 @@ QString RemoveVolumeGroupOperation::description() const
|
|||
|
||||
void RemoveVolumeGroupOperation::preview()
|
||||
{
|
||||
m_PartitionTable = device().partitionTable();
|
||||
device().setPartitionTable(new PartitionTable(PartitionTable::vmd, 0, device().totalLogical() - 1));
|
||||
}
|
||||
|
||||
void RemoveVolumeGroupOperation::undo()
|
||||
{
|
||||
device().setPartitionTable(m_PartitionTable);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <QString>
|
||||
|
||||
class PartitionTable;
|
||||
class RemoveVolumeGroupJob;
|
||||
class VolumeManagerDevice;
|
||||
class OperationStack;
|
||||
|
@ -67,6 +68,7 @@ protected:
|
|||
private:
|
||||
RemoveVolumeGroupJob* m_RemoveVolumeGroupJob;
|
||||
VolumeManagerDevice& m_Device;
|
||||
PartitionTable* m_PartitionTable;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue