[partition] Switch to convenience function for MiB
This commit is contained in:
parent
38688bab47
commit
5c4286eebf
@ -20,11 +20,15 @@
|
||||
|
||||
#include "jobs/ResizePartitionJob.h"
|
||||
|
||||
#include "utils/Units.h"
|
||||
|
||||
// KPMcore
|
||||
#include <core/device.h>
|
||||
#include <ops/resizeoperation.h>
|
||||
#include <util/report.h>
|
||||
|
||||
using CalamaresUtils::BytesToMiB;
|
||||
|
||||
//- ResizePartitionJob ---------------------------------------------------------
|
||||
ResizePartitionJob::ResizePartitionJob( Device* device, Partition* partition, qint64 firstSector, qint64 lastSector )
|
||||
: PartitionJob( partition )
|
||||
@ -51,8 +55,8 @@ ResizePartitionJob::prettyDescription() const
|
||||
return tr( "Resize <strong>%2MB</strong> partition <strong>%1</strong> to "
|
||||
"<strong>%3MB</strong>." )
|
||||
.arg( partition()->partitionPath() )
|
||||
.arg( ( m_oldLastSector - m_oldFirstSector + 1 ) * partition()->sectorSize() / 1024 / 1024 )
|
||||
.arg( ( m_newLastSector - m_newFirstSector + 1 ) * partition()->sectorSize() / 1024 / 1024 );
|
||||
.arg( ( BytesToMiB( m_oldLastSector - m_oldFirstSector + 1 ) * partition()->sectorSize() ) )
|
||||
.arg( ( BytesToMiB( m_newLastSector - m_newFirstSector + 1 ) * partition()->sectorSize() ) );
|
||||
}
|
||||
|
||||
|
||||
@ -62,8 +66,8 @@ ResizePartitionJob::prettyStatusMessage() const
|
||||
return tr( "Resizing %2MB partition %1 to "
|
||||
"%3MB." )
|
||||
.arg( partition()->partitionPath() )
|
||||
.arg( ( m_oldLastSector - m_oldFirstSector + 1 ) * partition()->sectorSize() / 1024 / 1024 )
|
||||
.arg( ( m_newLastSector - m_newFirstSector + 1 ) * partition()->sectorSize() / 1024 / 1024 );
|
||||
.arg( ( BytesToMiB( m_oldLastSector - m_oldFirstSector + 1 ) * partition()->sectorSize() ) )
|
||||
.arg( ( BytesToMiB( m_newLastSector - m_newFirstSector + 1 ) * partition()->sectorSize() ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "SetPartitionFlagsJob.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Units.h"
|
||||
|
||||
// KPMcore
|
||||
#include <core/device.h>
|
||||
@ -30,6 +31,8 @@
|
||||
#include <ops/setpartflagsoperation.h>
|
||||
#include <util/report.h>
|
||||
|
||||
using CalamaresUtils::BytesToMiB;
|
||||
|
||||
SetPartFlagsJob::SetPartFlagsJob( Device* device,
|
||||
Partition* partition,
|
||||
PartitionTable::Flags flags )
|
||||
@ -47,7 +50,7 @@ SetPartFlagsJob::prettyName() const
|
||||
|
||||
if ( !partition()->fileSystem().name().isEmpty() )
|
||||
return tr( "Set flags on %1MB %2 partition." )
|
||||
.arg( partition()->capacity() /1024 /1024 )
|
||||
.arg( BytesToMiB( partition()->capacity() ) )
|
||||
.arg( partition()->fileSystem().name() );
|
||||
|
||||
return tr( "Set flags on new partition." );
|
||||
@ -66,7 +69,7 @@ SetPartFlagsJob::prettyDescription() const
|
||||
|
||||
if ( !partition()->fileSystem().name().isEmpty() )
|
||||
return tr( "Clear flags on %1MB <strong>%2</strong> partition." )
|
||||
.arg( partition()->capacity() /1024 /1024 )
|
||||
.arg( BytesToMiB( partition()->capacity() ) )
|
||||
.arg( partition()->fileSystem().name() );
|
||||
|
||||
return tr( "Clear flags on new partition." );
|
||||
@ -81,7 +84,7 @@ SetPartFlagsJob::prettyDescription() const
|
||||
if ( !partition()->fileSystem().name().isEmpty() )
|
||||
return tr( "Flag %1MB <strong>%2</strong> partition as "
|
||||
"<strong>%3</strong>." )
|
||||
.arg( partition()->capacity() /1024 /1024 )
|
||||
.arg( BytesToMiB( partition()->capacity() ) )
|
||||
.arg( partition()->fileSystem().name() )
|
||||
.arg( flagsList.join( ", " ) );
|
||||
|
||||
@ -102,7 +105,7 @@ SetPartFlagsJob::prettyStatusMessage() const
|
||||
|
||||
if ( !partition()->fileSystem().name().isEmpty() )
|
||||
return tr( "Clearing flags on %1MB <strong>%2</strong> partition." )
|
||||
.arg( partition()->capacity() /1024 /1024 )
|
||||
.arg( BytesToMiB( partition()->capacity() ) )
|
||||
.arg( partition()->fileSystem().name() );
|
||||
|
||||
return tr( "Clearing flags on new partition." );
|
||||
@ -117,7 +120,7 @@ SetPartFlagsJob::prettyStatusMessage() const
|
||||
if ( !partition()->fileSystem().name().isEmpty() )
|
||||
return tr( "Setting flags <strong>%3</strong> on "
|
||||
"%1MB <strong>%2</strong> partition." )
|
||||
.arg( partition()->capacity() /1024 /1024 )
|
||||
.arg( BytesToMiB( partition()->capacity() ) )
|
||||
.arg( partition()->fileSystem().name() )
|
||||
.arg( flagsList.join( ", " ) );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user