Switch to using PartSize class for partition sizes

Every call of `ParseStringSize` is replaced by using an instance of the
`PartUtils::PartSize` class.

This commit also removes the now-unused previous size parsing functions.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
Arnaud Ferraris 2019-04-17 18:40:30 +02:00
parent 3a58ae5e8b
commit d32733bf59
5 changed files with 17 additions and 124 deletions

View file

@ -102,9 +102,14 @@ doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionO
if ( isEfi )
{
if ( gs->contains( "efiSystemPartitionSize" ) )
uefisys_part_sizeB = PartUtils::parseSizeString( gs->value( "efiSystemPartitionSize" ).toString(), dev->capacity() );
{
PartUtils::PartSize part_size = PartUtils::PartSize( gs->value( "efiSystemPartitionSize" ).toString() );
uefisys_part_sizeB = part_size.toBytes( dev->capacity() );
}
else
{
uefisys_part_sizeB = 300_MiB;
}
}
// Since sectors count from 0, if the space is 2048 sectors in size,