Commit 4101b096 authored by Mike Fleetwood's avatar Mike Fleetwood Committed by Curtis Gedak

Update file system usage last in prepare_new_partition() (#48)

Move setting of the new_partition object file system usage to after
everything else, specifically after free_space_before and strict_start.
This is because snap_to_*() use free_space_before and strict_start and
snap_to_alignment() is going to be called before the file system usage
is updated to avoid the error in this bug report.

Closes #48 - Error when moving locked LUKS-encrypted partition
parent 14aa9276
......@@ -220,6 +220,12 @@ void Dialog_Base_Partition::prepare_new_partition()
break;
}
new_partition->free_space_before = Sector(spinbutton_before.get_value_as_int()) * (MEBIBYTE / new_partition->sector_size);
// If the original before value has not changed, then set indicator to keep start sector unchanged.
if ( ORIG_BEFORE == spinbutton_before .get_value_as_int() )
new_partition->strict_start = TRUE;
//update partition usage
if ( new_partition->sector_usage_known() )
{
......@@ -240,12 +246,6 @@ void Dialog_Base_Partition::prepare_new_partition()
new_partition->set_sector_usage( new_size, new_size - new_partition->sectors_used );
}
}
new_partition->free_space_before = Sector(spinbutton_before.get_value_as_int()) * (MEBIBYTE / new_partition->sector_size);
//if the original before value has not changed, then set indicator to keep start sector unchanged
if ( ORIG_BEFORE == spinbutton_before .get_value_as_int() )
new_partition->strict_start = TRUE;
}
void Dialog_Base_Partition::Set_Confirm_Button( CONFIRMBUTTON button_type )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment