Replace whole path list after calibrate in apply_operation_to_disk() (#766349)

When replacing the list of paths for the other partition object involved
in either a Resize/Move or Format operation in apply_operation_to_disk()
should replace the whole list of partitions not just replace with the
first path.  Copy the whole path list is the correct action.  It makes
no material difference because secondary partition paths are only used
to discover mount points during refresh phase and not at the apply
phase, where only the primary path is used.

Bug 766349 - Resolve code ugliness with partition path getting set to
             "copy of /dev/SRC"
This commit is contained in:
Mike Fleetwood 2016-05-15 18:09:31 +01:00 committed by Curtis Gedak
parent b77fef0dd5
commit ab923121de
1 changed files with 12 additions and 6 deletions

View File

@ -758,9 +758,12 @@ bool GParted_Core::apply_operation_to_disk( Operation * operation )
if ( ! success ) if ( ! success )
break; break;
// Reset the new partition object's real path in case the name is // Replace the new partition object's list of paths from the
// "copy of ..." from the previous operation. // calibration in case the first path is "Copy of ..." from the
operation->get_partition_new().add_path( operation->get_partition_original().get_path(), true ); // partition having been newly created by a paste into unallocated
// space earlier in the sequence of operations now being applied.
operation->get_partition_new().add_paths( operation->get_partition_original().get_paths(),
true );
success = resize_move( operation->get_partition_original(), success = resize_move( operation->get_partition_original(),
operation->get_partition_new(), operation->get_partition_new(),
@ -772,9 +775,12 @@ bool GParted_Core::apply_operation_to_disk( Operation * operation )
if ( ! success ) if ( ! success )
break; break;
// Reset the original partition object's real path in case the // Replace the original partition object's list of paths from the
// name is "copy of ..." from the previous operation. // calibration in case the first path is "Copy of ..." from the
operation->get_partition_original().add_path( operation->get_partition_new().get_path(), true ); // partition having been newly created by a paste into unallocated
// space earlier in the sequence of operations now being applied.
operation->get_partition_original().add_paths( operation->get_partition_new().get_paths(),
true );
success = remove_filesystem( operation->get_partition_original(), success = remove_filesystem( operation->get_partition_original(),
operation->operation_detail ) operation->operation_detail )