[libcalamares] Don't write out pragmas by hand, use Qt helpers

This commit is contained in:
Adriaan de Groot 2024-10-22 21:24:23 +02:00
parent f4d62f0f41
commit 16cb360a69

View File

@ -22,10 +22,8 @@ namespace Partition
QString QString
prettyNameForFileSystemType( FileSystem::Type t ) prettyNameForFileSystemType( FileSystem::Type t )
{ {
#ifdef __clang__ QT_WARNING_PUSH
#pragma clang diagnostic push QT_WARNING_DISABLE_CLANG( "-Wswitch-enum" )
#pragma clang diagnostic ignored "-Wswitch-enum"
#endif
// 13 enumeration values not handled // 13 enumeration values not handled
switch ( t ) switch ( t )
{ {
@ -66,18 +64,14 @@ prettyNameForFileSystemType( FileSystem::Type t )
default: default:
return FileSystem::nameForType( t ); return FileSystem::nameForType( t );
} }
#ifdef __clang__ QT_WARNING_POP
#pragma clang diagnostic pop
#endif
} }
QString QString
untranslatedFS( FileSystem::Type t ) untranslatedFS( FileSystem::Type t )
{ {
#ifdef __clang__ QT_WARNING_PUSH
#pragma clang diagnostic push QT_WARNING_DISABLE_CLANG( "-Wswitch-enum" )
#pragma clang diagnostic ignored "-Wswitch-enum"
#endif
// 34 enumeration values not handled // 34 enumeration values not handled
switch ( t ) switch ( t )
{ {
@ -86,9 +80,7 @@ untranslatedFS( FileSystem::Type t )
default: default:
return FileSystem::nameForType( t, { QStringLiteral( "C" ) } ); return FileSystem::nameForType( t, { QStringLiteral( "C" ) } );
} }
#ifdef __clang__ QT_WARNING_POP
#pragma clang diagnostic pop
#endif
} }
} // namespace Partition } // namespace Partition