Revert "Disable OperationStack merging of operations for luks partitions."
This is no longer necessary now that copying/resizing of new luks partitions is
forbidden.
This reverts commit aec564f1a2
.
This commit is contained in:
parent
9c2f187ed9
commit
ffa24e4451
|
@ -68,15 +68,15 @@ OperationStack::~OperationStack()
|
||||||
<!-- 1 -->
|
<!-- 1 -->
|
||||||
<li>An existing operation created a Partition that is now being deleted: In this case, just remove
|
<li>An existing operation created a Partition that is now being deleted: In this case, just remove
|
||||||
the corresponding NewOperation from the OperationStack.<br/>This does not work for
|
the corresponding NewOperation from the OperationStack.<br/>This does not work for
|
||||||
extended partitions (#232092) and luks partitions.</li>
|
extended partitions.(#232092)</li>
|
||||||
<!-- 2 -->
|
<!-- 2 -->
|
||||||
<li>An existing Operation created a Partition that is now being moved or resized. In this case,
|
<li>An existing Operation created a Partition that is now being moved or resized. In this case,
|
||||||
remove the original NewOperation and create a new NewOperation with updated start and end
|
remove the original NewOperation and create a new NewOperation with updated start and end
|
||||||
sectors. This new NewOperation is appended to the OperationStack.<br/>This does not work for
|
sectors. This new NewOperation is appended to the OperationStack.<br/>This does not work for
|
||||||
extended partitions(#232092) and luks partitions.</li>
|
extended partitions.(#232092)</li>
|
||||||
<!-- 3 -->
|
<!-- 3 -->
|
||||||
<li>An existing NewOperation created a Partition that is now being copied. We're not copying
|
<li>An existing NewOperation created a Partition that is now being copied. We're not copying
|
||||||
but instead creating another new Partition in its place. This does not work for luks partitions.</li>
|
but instead creating another new Partition in its place.</li>
|
||||||
<!-- 4 -->
|
<!-- 4 -->
|
||||||
<li>The label for a new Partition's FileSystem is modified: Modify in NewOperation and forget it.</li>
|
<li>The label for a new Partition's FileSystem is modified: Modify in NewOperation and forget it.</li>
|
||||||
<!-- 5 -->
|
<!-- 5 -->
|
||||||
|
@ -105,9 +105,7 @@ bool OperationStack::mergeNewOperation(Operation*& currentOp, Operation*& pushed
|
||||||
CheckOperation* pushedCheckOp = dynamic_cast<CheckOperation*>(pushedOp);
|
CheckOperation* pushedCheckOp = dynamic_cast<CheckOperation*>(pushedOp);
|
||||||
|
|
||||||
// -- 1 --
|
// -- 1 --
|
||||||
if (pushedDeleteOp && &newOp->newPartition() == &pushedDeleteOp->deletedPartition() &&
|
if (pushedDeleteOp && &newOp->newPartition() == &pushedDeleteOp->deletedPartition() && !pushedDeleteOp->deletedPartition().roles().has(PartitionRole::Extended)) {
|
||||||
!pushedDeleteOp->deletedPartition().roles().has(PartitionRole::Extended) &&
|
|
||||||
!pushedDeleteOp->deletedPartition().roles().has(PartitionRole::Luks)) {
|
|
||||||
Log() << i18nc("@info/plain", "Deleting a partition just created: Undoing the operation to create the partition.");
|
Log() << i18nc("@info/plain", "Deleting a partition just created: Undoing the operation to create the partition.");
|
||||||
|
|
||||||
delete pushedOp;
|
delete pushedOp;
|
||||||
|
@ -120,9 +118,7 @@ bool OperationStack::mergeNewOperation(Operation*& currentOp, Operation*& pushed
|
||||||
}
|
}
|
||||||
|
|
||||||
// -- 2 --
|
// -- 2 --
|
||||||
if (pushedResizeOp && &newOp->newPartition() == &pushedResizeOp->partition() &&
|
if (pushedResizeOp && &newOp->newPartition() == &pushedResizeOp->partition() && !pushedResizeOp->partition().roles().has(PartitionRole::Extended)) {
|
||||||
!pushedResizeOp->partition().roles().has(PartitionRole::Extended) &&
|
|
||||||
!pushedResizeOp->partition().roles().has(PartitionRole::Luks)) {
|
|
||||||
// NOTE: In theory it would be possible to merge resizing an extended as long as it has no children.
|
// NOTE: In theory it would be possible to merge resizing an extended as long as it has no children.
|
||||||
// But that still doesn't save us: If we're not merging a resize on an extended that has children,
|
// But that still doesn't save us: If we're not merging a resize on an extended that has children,
|
||||||
// a resizeop is added to the stack. Next, the user deletes the child. Then he resizes the
|
// a resizeop is added to the stack. Next, the user deletes the child. Then he resizes the
|
||||||
|
@ -147,8 +143,7 @@ bool OperationStack::mergeNewOperation(Operation*& currentOp, Operation*& pushed
|
||||||
}
|
}
|
||||||
|
|
||||||
// -- 3 --
|
// -- 3 --
|
||||||
if (pushedCopyOp && &newOp->newPartition() == &pushedCopyOp->sourcePartition() &&
|
if (pushedCopyOp && &newOp->newPartition() == &pushedCopyOp->sourcePartition()) {
|
||||||
!pushedCopyOp->sourcePartition().roles().has(PartitionRole::Luks)) {
|
|
||||||
Log() << i18nc("@info/plain", "Copying a new partition: Creating a new partition instead.");
|
Log() << i18nc("@info/plain", "Copying a new partition: Creating a new partition instead.");
|
||||||
|
|
||||||
Partition* newPartition = new Partition(newOp->newPartition());
|
Partition* newPartition = new Partition(newOp->newPartition());
|
||||||
|
|
Loading…
Reference in New Issue