diff --git a/src/libcalamares/partition/FSName.h b/src/libcalamares/partition/FSName.h deleted file mode 100644 index f7dfcf5b4..000000000 --- a/src/libcalamares/partition/FSName.h +++ /dev/null @@ -1,52 +0,0 @@ -/* === This file is part of Calamares - === - * - * Copyright 2020, Adriaan de Groot - * - * Calamares is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Calamares is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Calamares. If not, see . - */ - -/** @brief Gets filesystem names from KPMCore - * - * A name (e.g. "ext4") can be for internal, untranslated, use, or for - * user-visible use. In the latter case it should be translated. The - * KPMCore API gives user-visible names by default. - */ -#ifndef PARTITION_FSNAME_H -#define PARTITION_FSNAME_H - -#include - -#include - -namespace CalamaresUtils -{ -namespace Partition -{ - -static inline QString -untranslatedFS( FileSystem& fs ) -{ - return fs.name( { QStringLiteral( "C" ) } ); -} - -static inline QString -untranslatedFS( FileSystem* fs ) -{ - return fs ? untranslatedFS( *fs ) : QString(); -} - -} // namespace Partition -} // namespace CalamaresUtils - -#endif // PARTITION_FSNAME_H diff --git a/src/modules/partition/core/KPMHelpers.h b/src/modules/partition/core/KPMHelpers.h index bca69d1f6..7ef9718ae 100644 --- a/src/modules/partition/core/KPMHelpers.h +++ b/src/modules/partition/core/KPMHelpers.h @@ -114,6 +114,19 @@ Partition* createNewEncryptedPartition( PartitionNode* parent, Partition* clonePartition( Device* device, Partition* partition ); QString prettyNameForFileSystemType( FileSystem::Type t ); + +static inline QString +untranslatedFS( FileSystem& fs ) +{ + return fs.name( { QStringLiteral( "C" ) } ); +} + +static inline QString +untranslatedFS( FileSystem* fs ) +{ + return fs ? untranslatedFS( *fs ) : QString(); +} + } #endif /* KPMHELPERS_H */ diff --git a/src/modules/partition/jobs/FillGlobalStorageJob.cpp b/src/modules/partition/jobs/FillGlobalStorageJob.cpp index 77b1e8aaa..10554209c 100644 --- a/src/modules/partition/jobs/FillGlobalStorageJob.cpp +++ b/src/modules/partition/jobs/FillGlobalStorageJob.cpp @@ -20,11 +20,12 @@ #include "jobs/FillGlobalStorageJob.h" -#include "GlobalStorage.h" -#include "JobQueue.h" #include "core/PartitionInfo.h" #include "core/PartitionIterator.h" #include "core/KPMHelpers.h" + +#include "GlobalStorage.h" +#include "JobQueue.h" #include "Branding.h" #include "utils/Logger.h" @@ -40,6 +41,8 @@ #include #include +using KPMHelpers::untranslatedFS; + typedef QHash UuidForPartitionHash; static UuidForPartitionHash @@ -85,11 +88,11 @@ mapForPartition( Partition* partition, const QString& uuid ) QVariantMap map; map[ "device" ] = partition->partitionPath(); map[ "mountPoint" ] = PartitionInfo::mountPoint( partition ); - map[ "fsName" ] = partition->fileSystem().name(); - map[ "fs" ] = partition->fileSystem().name( { QStringLiteral("C") } ); // Untranslated + map[ "fsName" ] = partition->fileSystem().name(); // User-visible + map[ "fs" ] = untranslatedFS( partition->fileSystem() ); if ( partition->fileSystem().type() == FileSystem::Luks && dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS() ) - map[ "fs" ] = dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS()->name( { QStringLiteral("C") } ); + map[ "fs" ] = untranslatedFS( dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS() ); map[ "uuid" ] = uuid; // Debugging for inside the loop in createPartitionList(),