[partition] Write out type rather than aliasing to T

This commit is contained in:
Adriaan de Groot 2021-07-05 13:11:00 +02:00
parent 7ea6768852
commit 1a542d3afe
2 changed files with 42 additions and 41 deletions

View File

@ -432,14 +432,15 @@ PartitionViewStep::onLeave()
{ {
if ( PartUtils::isEfiSystem() ) if ( PartUtils::isEfiSystem() )
{ {
QString espMountPoint const QString espMountPoint
= Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString(); = Calamares::JobQueue::instance()->globalStorage()->value( "efiSystemPartition" ).toString();
const QString espFlagName = PartitionTable::flagName(
#ifdef WITH_KPMCORE4API #ifdef WITH_KPMCORE4API
auto espFlag = PartitionTable::Flag::Boot; PartitionTable::Flag::Boot
#else #else
auto espFlag = PartitionTable::FlagEsp; PartitionTable::FlagEsp
#endif #endif
QString espFlagName = PartitionTable::flagName( espFlag ); );
Partition* esp = m_core->findPartitionByMountPoint( espMountPoint ); Partition* esp = m_core->findPartitionByMountPoint( espMountPoint );
QString message; QString message;

View File

@ -140,55 +140,55 @@ PartitionLayout::init( FileSystem::Type defaultFsType, const QVariantList& confi
void void
PartitionLayout::setDefaultFsType(FileSystem::Type defaultFsType) PartitionLayout::setDefaultFsType(FileSystem::Type defaultFsType)
{ {
using T = FileSystem::Type; using FileSystem = FileSystem::Type;
switch ( defaultFsType ) switch ( defaultFsType )
{ {
case T::Unknown: case FileSystem::Unknown:
case T::Unformatted: case FileSystem::Unformatted:
case T::Extended: case FileSystem::Extended:
case T::LinuxSwap: case FileSystem::LinuxSwap:
case T::Luks: case FileSystem::Luks:
case T::Ocfs2: case FileSystem::Ocfs2:
case T::Lvm2_PV: case FileSystem::Lvm2_PV:
case T::Udf: case FileSystem::Udf:
case T::Iso9660: case FileSystem::Iso9660:
case T::Luks2: case FileSystem::Luks2:
case T::LinuxRaidMember: case FileSystem::LinuxRaidMember:
case T::BitLocker: case FileSystem::BitLocker:
// bad bad // bad bad
cWarning() << "The selected default FS" << defaultFsType << "is not suitable." << "Using ext4 instead."; cWarning() << "The selected default FS" << defaultFsType << "is not suitable." << "Using ext4 instead.";
defaultFsType = T::Ext4; defaultFsType = FileSystem::Ext4;
break; break;
case T::Ext2: case FileSystem::Ext2:
case T::Ext3: case FileSystem::Ext3:
case T::Ext4: case FileSystem::Ext4:
case T::Fat32: case FileSystem::Fat32:
case T::Ntfs: case FileSystem::Ntfs:
case T::Reiser4: case FileSystem::Reiser4:
case T::ReiserFS: case FileSystem::ReiserFS:
case T::Xfs: case FileSystem::Xfs:
case T::Jfs: case FileSystem::Jfs:
case T::Btrfs: case FileSystem::Btrfs:
case T::Exfat: case FileSystem::Exfat:
case T::F2fs: case FileSystem::F2fs:
// ok // ok
break; break;
case T::Fat12: case FileSystem::Fat12:
case T::Fat16: case FileSystem::Fat16:
case T::Hfs: case FileSystem::Hfs:
case T::HfsPlus: case FileSystem::HfsPlus:
case T::Ufs: case FileSystem::Ufs:
case T::Hpfs: case FileSystem::Hpfs:
case T::Zfs: case FileSystem::Zfs:
case T::Nilfs2: case FileSystem::Nilfs2:
case T::Apfs: case FileSystem::Apfs:
case T::Minix: case FileSystem::Minix:
// weird // weird
cWarning() << "The selected default FS" << defaultFsType << "is unusual, but not wrong."; cWarning() << "The selected default FS" << defaultFsType << "is unusual, but not wrong.";
break; break;
default: default:
cWarning() << "The selected default FS" << defaultFsType << "is not known to Calamares." << "Using ext4 instead."; cWarning() << "The selected default FS" << defaultFsType << "is not known to Calamares." << "Using ext4 instead.";
defaultFsType = T::Ext4; defaultFsType = FileSystem::Ext4;
} }
m_defaultFsType = defaultFsType; m_defaultFsType = defaultFsType;