Remove device's partitionTable when deactivated.
This commit is contained in:
parent
8a3c11774c
commit
fabde86139
|
@ -32,7 +32,8 @@ DeactivateVolumeGroupOperation::DeactivateVolumeGroupOperation(VolumeManagerDevi
|
||||||
Operation(),
|
Operation(),
|
||||||
m_DeactivateVolumeGroupJob(new DeactivateVolumeGroupJob(d)),
|
m_DeactivateVolumeGroupJob(new DeactivateVolumeGroupJob(d)),
|
||||||
m_DeactivateLogicalVolumeJob(new DeactivateLogicalVolumeJob(d)),
|
m_DeactivateLogicalVolumeJob(new DeactivateLogicalVolumeJob(d)),
|
||||||
m_Device(d)
|
m_Device(d),
|
||||||
|
m_PartitionTable(d.partitionTable())
|
||||||
{
|
{
|
||||||
addJob(deactivateLogicalVolumeJob());
|
addJob(deactivateLogicalVolumeJob());
|
||||||
addJob(deactivateVolumeGroupJob());
|
addJob(deactivateVolumeGroupJob());
|
||||||
|
@ -45,8 +46,14 @@ QString DeactivateVolumeGroupOperation::description() const
|
||||||
|
|
||||||
void DeactivateVolumeGroupOperation::preview()
|
void DeactivateVolumeGroupOperation::preview()
|
||||||
{
|
{
|
||||||
|
device().setPartitionTable(new PartitionTable(PartitionTable::vmd, 0, device().totalLogical() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeactivateVolumeGroupOperation::undo()
|
void DeactivateVolumeGroupOperation::undo()
|
||||||
{
|
{
|
||||||
|
PartitionTable* tmp = device().partitionTable();
|
||||||
|
if (tmp != partitionTable()) {
|
||||||
|
device().setPartitionTable(partitionTable());
|
||||||
|
delete tmp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ class DeactivateLogicalVolumeJob;
|
||||||
class DeactivateVolumeGroupJob;
|
class DeactivateVolumeGroupJob;
|
||||||
class VolumeManagerDevice;
|
class VolumeManagerDevice;
|
||||||
class OperationStack;
|
class OperationStack;
|
||||||
|
class PartitionTable;
|
||||||
|
|
||||||
class LIBKPMCORE_EXPORT DeactivateVolumeGroupOperation : public Operation
|
class LIBKPMCORE_EXPORT DeactivateVolumeGroupOperation : public Operation
|
||||||
{
|
{
|
||||||
|
@ -70,10 +71,15 @@ protected:
|
||||||
return m_Device;
|
return m_Device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PartitionTable* partitionTable() {
|
||||||
|
return m_PartitionTable;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DeactivateVolumeGroupJob* m_DeactivateVolumeGroupJob;
|
DeactivateVolumeGroupJob* m_DeactivateVolumeGroupJob;
|
||||||
DeactivateLogicalVolumeJob* m_DeactivateLogicalVolumeJob;
|
DeactivateLogicalVolumeJob* m_DeactivateLogicalVolumeJob;
|
||||||
VolumeManagerDevice& m_Device;
|
VolumeManagerDevice& m_Device;
|
||||||
|
PartitionTable* m_PartitionTable;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue