[partition] Display partition label and path if set

Setting labels (e.g. in manual partitioning) landed some time
ago, but the progress display still shows a raw device path.
Make it more expressive.

FIXES #449
FIXES #540
This commit is contained in:
Adriaan de Groot 2022-04-25 16:06:24 +02:00
parent c48209a9dd
commit 5bff26e1e0

View File

@ -58,10 +58,13 @@ FormatPartitionJob::prettyDescription() const
QString
FormatPartitionJob::prettyStatusMessage() const
{
QString partitionLabel = m_partition->label().isEmpty()
? m_partition->partitionPath()
: tr( "%1 (%2)", "partition label %1 (device path %2)" )
.arg( m_partition->label(), m_partition->partitionPath() );
return tr( "Formatting partition %1 with "
"file system %2." )
.arg( m_partition->partitionPath() )
.arg( userVisibleFS( m_partition->fileSystem() ) );
.arg( partitionLabel, userVisibleFS( m_partition->fileSystem() ) );
}