[partition] Warnings--

Avoid the extra indirection through the otherwise-unused
prettyGptType(const QString&), construct table of names
only on first call to avoid static-initialization order
(though that's not important here).
main
Adriaan de Groot 4 years ago
parent 0ccd55e33f
commit df1d7dea61

@ -33,6 +33,11 @@ CreatePartitionJob::CreatePartitionJob( Device* device, Partition* partition )
{ {
} }
static QString
prettyGptType( const Partition* partition )
{
#ifdef WITH_KPMCORE42API
static const QMap< QString, QString > gptTypePrettyStrings = { static const QMap< QString, QString > gptTypePrettyStrings = {
{ "44479540-f297-41b2-9af7-d131d5f0458a", "Linux Root Partition (x86)" }, { "44479540-f297-41b2-9af7-d131d5f0458a", "Linux Root Partition (x86)" },
{ "4f68bce3-e8cd-4db1-96e7-fbcaf984b709", "Linux Root Partition (x86-64)" }, { "4f68bce3-e8cd-4db1-96e7-fbcaf984b709", "Linux Root Partition (x86-64)" },
@ -65,17 +70,8 @@ static const QMap< QString, QString > gptTypePrettyStrings = {
{ "ebd0a0a2-b9e5-4433-87c0-68b6b72699c7", "Microsoft basic data" }, { "ebd0a0a2-b9e5-4433-87c0-68b6b72699c7", "Microsoft basic data" },
}; };
static QString auto type = partition->type();
prettyGptType( const QString& type )
{
return gptTypePrettyStrings.value( type.toLower(), type ); return gptTypePrettyStrings.value( type.toLower(), type );
}
static QString
prettyGptType( const Partition* partition )
{
#ifdef WITH_KPMCORE42API
return prettyGptType( partition->type() );
#else #else
return QString(); return QString();
#endif #endif

Loading…
Cancel
Save