From bacca0469570f7e40bf820a3bdcdc60cbb0f2c0e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 13 Feb 2020 11:29:45 +0100 Subject: [PATCH] [partition] Be explicit about what's user visible in SetPartitionFlagsJob --- .../partition/jobs/SetPartitionFlagsJob.cpp | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/modules/partition/jobs/SetPartitionFlagsJob.cpp b/src/modules/partition/jobs/SetPartitionFlagsJob.cpp index d79f70479..09380a24c 100644 --- a/src/modules/partition/jobs/SetPartitionFlagsJob.cpp +++ b/src/modules/partition/jobs/SetPartitionFlagsJob.cpp @@ -21,6 +21,8 @@ #include "SetPartitionFlagsJob.h" +#include "core/KPMHelpers.h" + #include "utils/Logger.h" #include "utils/Units.h" @@ -32,6 +34,8 @@ #include using CalamaresUtils::BytesToMiB; +using KPMHelpers::untranslatedFS; +using KPMHelpers::userVisibleFS; SetPartFlagsJob::SetPartFlagsJob( Device* device, Partition* partition, @@ -48,10 +52,11 @@ SetPartFlagsJob::prettyName() const if ( !partition()->partitionPath().isEmpty() ) return tr( "Set flags on partition %1." ).arg( partition()->partitionPath() ); - if ( !partition()->fileSystem().name().isEmpty() ) + QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); + if ( !fsNameForUser.isEmpty() ) return tr( "Set flags on %1MiB %2 partition." ) .arg( BytesToMiB( partition()->capacity() ) ) - .arg( partition()->fileSystem().name() ); + .arg( fsNameForUser ); return tr( "Set flags on new partition." ); } @@ -67,10 +72,11 @@ SetPartFlagsJob::prettyDescription() const return tr( "Clear flags on partition %1." ) .arg( partition()->partitionPath() ); - if ( !partition()->fileSystem().name().isEmpty() ) + QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); + if ( !fsNameForUser.isEmpty() ) return tr( "Clear flags on %1MiB %2 partition." ) .arg( BytesToMiB( partition()->capacity() ) ) - .arg( partition()->fileSystem().name() ); + .arg( fsNameForUser ); return tr( "Clear flags on new partition." ); } @@ -81,11 +87,12 @@ SetPartFlagsJob::prettyDescription() const .arg( partition()->partitionPath() ) .arg( flagsList.join( ", " ) ); - if ( !partition()->fileSystem().name().isEmpty() ) + QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); + if ( !fsNameForUser.isEmpty() ) return tr( "Flag %1MiB %2 partition as " "%3." ) .arg( BytesToMiB( partition()->capacity() ) ) - .arg( partition()->fileSystem().name() ) + .arg( fsNameForUser ) .arg( flagsList.join( ", " ) ); return tr( "Flag new partition as %1." ) @@ -103,10 +110,11 @@ SetPartFlagsJob::prettyStatusMessage() const return tr( "Clearing flags on partition %1." ) .arg( partition()->partitionPath() ); - if ( !partition()->fileSystem().name().isEmpty() ) + QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); + if ( !fsNameForUser.isEmpty() ) return tr( "Clearing flags on %1MiB %2 partition." ) .arg( BytesToMiB( partition()->capacity() ) ) - .arg( partition()->fileSystem().name() ); + .arg( fsNameForUser ); return tr( "Clearing flags on new partition." ); } @@ -117,11 +125,12 @@ SetPartFlagsJob::prettyStatusMessage() const .arg( partition()->partitionPath() ) .arg( flagsList.join( ", " ) ); - if ( !partition()->fileSystem().name().isEmpty() ) + QString fsNameForUser = userVisibleFS( partition()->fileSystem() ); + if ( !fsNameForUser.isEmpty() ) return tr( "Setting flags %3 on " "%1MiB %2 partition." ) .arg( BytesToMiB( partition()->capacity() ) ) - .arg( partition()->fileSystem().name() ) + .arg( fsNameForUser ) .arg( flagsList.join( ", " ) ); return tr( "Setting flags %1 on new partition." )