diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index 3043a74e5..5a5ce4016 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -34,6 +34,11 @@ #include +#ifdef WITH_KOSRelease +#include +#include +#endif + namespace Calamares { @@ -146,9 +151,36 @@ Branding::Branding( const QString& brandingFilePath, initSimpleSettings( doc ); +#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(); + + + loadStrings( m_strings, doc, "strings", + [&]( const QString& s ) -> QString { return KMacroExpander::expandMacros{ s, relMap, '@' ); } + ); +#else + // No support for substituting in os-release values. loadStrings( m_strings, doc, "strings", []( const QString& s ) -> QString { return s; } ); +#endif loadStrings( m_images, doc, "images", [&]( const QString& s ) -> QString {