From ebecfb9f8b368bd913dba3d6fe1b4ddc1efaa285 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 29 Jun 2021 12:21:14 +0200 Subject: [PATCH] [partition] Simplify config-reading (now the variant-docs are better) --- src/modules/partition/Config.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/modules/partition/Config.cpp b/src/modules/partition/Config.cpp index 1e0a1ce84..7de7dbbe3 100644 --- a/src/modules/partition/Config.cpp +++ b/src/modules/partition/Config.cpp @@ -278,16 +278,7 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) if ( configurationMap.contains( "availableFileSystemTypes" ) ) { - QStringList fsTypes; - - if ( configurationMap.value( "availableFileSystemTypes" ).type() == QVariant::List ) - { - fsTypes = CalamaresUtils::getStringList( configurationMap, "availableFileSystemTypes" ); - } - else if ( configurationMap.value( "availableFileSystemTypes" ).type() == QVariant::String ) - { - fsTypes = QStringList { CalamaresUtils::getString( configurationMap, "availableFileSystemTypes" ) }; - } + QStringList fsTypes = CalamaresUtils::getStringList( configurationMap, "availableFileSystemTypes" ); m_eraseFsTypes = fsTypes; if ( !fsTypes.empty() ) @@ -297,18 +288,7 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) } } - if ( configurationMap.contains( "requiredPartitionTableType" ) - && configurationMap.value( "requiredPartitionTableType" ).type() == QVariant::List ) - { - m_requiredPartitionTableType.clear(); - m_requiredPartitionTableType.append( configurationMap.value( "requiredPartitionTableType" ).toStringList() ); - } - else if ( configurationMap.contains( "requiredPartitionTableType" ) - && configurationMap.value( "requiredPartitionTableType" ).type() == QVariant::String ) - { - m_requiredPartitionTableType.clear(); - m_requiredPartitionTableType.append( configurationMap.value( "requiredPartitionTableType" ).toString() ); - } + m_requiredPartitionTableType = CalamaresUtils::getStringList( configurationMap, "requiredPartitionTableType" ); gs->insert( "requiredPartitionTableType", m_requiredPartitionTableType ); fillGSConfigurationEFI(gs, configurationMap);