diff --git a/src/modules/partition/jobs/FillGlobalStorageJob.cpp b/src/modules/partition/jobs/FillGlobalStorageJob.cpp index 5384cf243..bda5365c3 100644 --- a/src/modules/partition/jobs/FillGlobalStorageJob.cpp +++ b/src/modules/partition/jobs/FillGlobalStorageJob.cpp @@ -91,6 +91,7 @@ mapForPartition( Partition* partition, const QString& uuid ) map[ "mountPoint" ] = PartitionInfo::mountPoint( partition ); map[ "fsName" ] = userVisibleFS( partition->fileSystem() ); map[ "fs" ] = untranslatedFS( partition->fileSystem() ); + map[ "features" ] = partition->fileSystem().features(); if ( partition->fileSystem().type() == FileSystem::Luks && dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS() ) { @@ -126,6 +127,33 @@ mapForPartition( Partition* partition, const QString& uuid ) return map; } +static QString +prettyFileSystemFeatures( const QVariantMap& features ) +{ + QStringList list; + for ( const auto& key : features.keys() ) + { + const auto& value = features.value( key ); + if ( value.type() == QVariant::Bool ) + { + if ( value.toBool() ) + { + list += key; + } + else + { + list += QString( "not " ) + key; + } + } + else + { + list += key + QString( "=" ) + value.toString(); + } + } + + return list.join( QStringLiteral( ", " ) ); +} + FillGlobalStorageJob::FillGlobalStorageJob( const Config*, QList< Device* > devices, const QString& bootLoaderPath ) : m_devices( devices ) , m_bootLoaderPath( bootLoaderPath ) @@ -153,6 +181,7 @@ FillGlobalStorageJob::prettyDescription() const QString path = partitionMap.value( "device" ).toString(); QString mountPoint = partitionMap.value( "mountPoint" ).toString(); QString fsType = partitionMap.value( "fs" ).toString(); + QString features = prettyFileSystemFeatures( partitionMap.value( "features" ).toMap() ); if ( mountPoint.isEmpty() || fsType.isEmpty() || fsType == QString( "unformatted" ) ) { continue; @@ -161,34 +190,81 @@ FillGlobalStorageJob::prettyDescription() const { if ( mountPoint == "/" ) { - lines.append( tr( "Install %1 on new %2 system partition." ) - .arg( Calamares::Branding::instance()->shortProductName() ) - .arg( fsType ) ); + if ( !features.isEmpty() ) + { + lines.append( tr( "Install %1 on new %2 system partition " + "with features %3" ) + .arg( Calamares::Branding::instance()->shortProductName() ) + .arg( fsType ) + .arg( features ) ); + } + else + { + lines.append( tr( "Install %1 on new %2 system partition." ) + .arg( Calamares::Branding::instance()->shortProductName() ) + .arg( fsType ) ); + } } else { - lines.append( tr( "Set up new %2 partition with mount point " - "%1." ) - .arg( mountPoint ) - .arg( fsType ) ); + if ( !features.isEmpty() ) + { + lines.append( tr( "Set up new %2 partition with mount point " + "%1 and features %3." ) + .arg( mountPoint ) + .arg( fsType ) + .arg( features ) ); + } + else + { + lines.append( tr( "Set up new %2 partition with mount point " + "%1%3." ) + .arg( mountPoint ) + .arg( fsType ) + .arg( features ) ); + } } } else { if ( mountPoint == "/" ) { - lines.append( tr( "Install %2 on %3 system partition %1." ) - .arg( path ) - .arg( Calamares::Branding::instance()->shortProductName() ) - .arg( fsType ) ); + if ( !features.isEmpty() ) + { + lines.append( tr( "Install %2 on %3 system partition %1" + " with features %4." ) + .arg( path ) + .arg( Calamares::Branding::instance()->shortProductName() ) + .arg( fsType ) + .arg( features ) ); + } + else + { + lines.append( tr( "Install %2 on %3 system partition %1." ) + .arg( path ) + .arg( Calamares::Branding::instance()->shortProductName() ) + .arg( fsType ) ); + } } else { - lines.append( tr( "Set up %3 partition %1 with mount point " - "%2." ) - .arg( path ) - .arg( mountPoint ) - .arg( fsType ) ); + if ( !features.isEmpty() ) + { + lines.append( tr( "Set up %3 partition %1 with mount point " + "%2 and features %4." ) + .arg( path ) + .arg( mountPoint ) + .arg( fsType ) + .arg( features ) ); + } + else + { + lines.append( tr( "Set up %3 partition %1 with mount point " + "%2%4." ) + .arg( path ) + .arg( mountPoint ) + .arg( fsType ) ); + } } } }