From d3783ef29363ae346801a39a7ca3e56de8abf771 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 6 May 2019 16:47:11 +0200 Subject: [PATCH] [partition] Use GiB and MiB consistently --- src/modules/partition/gui/ChoicePage.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 956cdbd10..04eec56ed 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -563,8 +563,7 @@ ChoicePage::doAlongsideSetupSplitter( const QModelIndex& current, ->value( "requiredStorageGiB" ) .toDouble(); - // TODO: make this consistent - qint64 requiredStorageB = qRound64( requiredStorageGB + 0.1 + 2.0 ) * 1024 * 1024 * 1024; + qint64 requiredStorageB = CalamaresUtils::GiBtoBytes( requiredStorageGB + 0.1 + 2.0 ); m_afterPartitionSplitterWidget->setSplitPartition( part->partitionPath(), @@ -967,11 +966,11 @@ ChoicePage::updateActionChoicePreview( ChoicePage::InstallChoice choice ) qint64 sizeNext ) { Q_UNUSED( path ) - sizeLabel->setText( tr( "%1 will be shrunk to %2MB and a new " - "%3MB partition will be created for %4." ) + sizeLabel->setText( tr( "%1 will be shrunk to %2MiB and a new " + "%3MiB partition will be created for %4." ) .arg( m_beforePartitionBarsView->selectionModel()->currentIndex().data().toString() ) - .arg( size / ( 1024 * 1024 ) ) - .arg( sizeNext / ( 1024 * 1024 ) ) + .arg( CalamaresUtils::BytesToMiB( size ) ) + .arg( CalamaresUtils::BytesToMiB( sizeNext ) ) .arg( *Calamares::Branding::ShortProductName ) ); } );