diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index 5a5ce4016..2f9407bb7 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -153,27 +153,28 @@ Branding::Branding( const QString& brandingFilePath, #ifdef WITH_KOSRelease KOSRelease relInfo; - QHash relMap; - relMap << "NAME" << relInfo.name() - << "VERSION" << relInfo.version() - << "ID" << relInfo.id() - << "ID_LIKE" << relInfo.idLike() - << "VERSION_CODENAME" << relInfo.versionCodename() - << "VERSION_ID" << relInfo.versionId() - << "PRETTY_NAME" << relInfo.prettyName() - << "HOME_URL" << relInfo.homeUrl() - << "DOCUMENTATION_URL" << relInfo.documentationUrl() - << "SUPPORT_URL" << relInfo.supportUrl() - << "BUG_REPORT_URL" << relInfo.bugReportUrl() - << "PRIVACY_POLICY_URL" << relInfo.privacyPolicyUrl() - << "BUILD_ID" << relInfo.buildId() - << "VARIANT" << relInfo.variant() - << "VARIANT_ID" << relInfo.variantId() - << "LOGO" << relInfo.logo(); - - + + QHash< QString, QString > relMap{ + std::initializer_list< std::pair< QString, QString > > { + { QStringLiteral( "NAME" ), relInfo.name() }, + { QStringLiteral( "VERSION" ), relInfo.version() }, + { QStringLiteral( "ID" ), relInfo.id() }, + { QStringLiteral( "ID_LIKE" ), relInfo.idLike().join( ' ' ) }, + { QStringLiteral( "VERSION_CODENAME" ), relInfo.versionCodename() }, + { QStringLiteral( "VERSION_ID" ), relInfo.versionId() }, + { QStringLiteral( "PRETTY_NAME" ), relInfo.prettyName() }, + { QStringLiteral( "HOME_URL" ), relInfo.homeUrl() }, + { QStringLiteral( "DOCUMENTATION_URL" ), relInfo.documentationUrl() }, + { QStringLiteral( "SUPPORT_URL" ), relInfo.supportUrl() }, + { QStringLiteral( "BUG_REPORT_URL" ), relInfo.bugReportUrl() }, + { QStringLiteral( "PRIVACY_POLICY_URL" ), relInfo.privacyPolicyUrl() }, + { QStringLiteral( "BUILD_ID" ), relInfo.buildId() }, + { QStringLiteral( "VARIANT" ), relInfo.variant() }, + { QStringLiteral( "VARIANT_ID" ), relInfo.variantId() }, + { QStringLiteral( "LOGO" ), relInfo.logo() } + } }; loadStrings( m_strings, doc, "strings", - [&]( const QString& s ) -> QString { return KMacroExpander::expandMacros{ s, relMap, '@' ); } + [&]( const QString& s ) -> QString { return KMacroExpander::expandMacros( s, relMap, QLatin1Char( '@' ) ); } ); #else // No support for substituting in os-release values. diff --git a/src/libcalamaresui/CMakeLists.txt b/src/libcalamaresui/CMakeLists.txt index 7776cd496..f6c8c9ac7 100644 --- a/src/libcalamaresui/CMakeLists.txt +++ b/src/libcalamaresui/CMakeLists.txt @@ -87,4 +87,5 @@ calamares_add_library( calamaresui find_package( KF5CoreAddons 5.58 QUIET ) # If it's really new if ( KF5CoreAddons_FOUND ) target_compile_definitions( calamaresui PRIVATE WITH_KOSRelease ) + target_link_libraries( calamaresui PRIVATE KF5::CoreAddons ) endif()