libcalamaresui: always use KOSRelease

The places where KOSRelease was ifdeffed always set the ifdef in
the surrounding CMake code, so make it unconditional.
This commit is contained in:
Adriaan de Groot 2023-10-17 22:46:11 +02:00
parent 63b0589382
commit aaa82386d8
4 changed files with 1 additions and 12 deletions

View File

@ -30,10 +30,8 @@
#include <functional> #include <functional>
#ifdef WITH_KOSRelease
#include <KMacroExpander> #include <KMacroExpander>
#include <KOSRelease> #include <KOSRelease>
#endif
[[noreturn]] static void [[noreturn]] static void
bail( const QString& descriptorPath, const QString& message ) bail( const QString& descriptorPath, const QString& message )
@ -238,7 +236,6 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent, qreal devi
initSimpleSettings( doc ); initSimpleSettings( doc );
initSlideshowSettings( doc ); initSlideshowSettings( doc );
#ifdef WITH_KOSRelease
// Copy the os-release information into a QHash for use by KMacroExpander. // Copy the os-release information into a QHash for use by KMacroExpander.
KOSRelease relInfo; KOSRelease relInfo;
@ -261,9 +258,7 @@ Branding::Branding( const QString& brandingFilePath, QObject* parent, qreal devi
{ QStringLiteral( "LOGO" ), relInfo.logo() } } }; { QStringLiteral( "LOGO" ), relInfo.logo() } } };
auto expand = [ & ]( const QString& s ) -> QString auto expand = [ & ]( const QString& s ) -> QString
{ return KMacroExpander::expandMacros( s, relMap, QLatin1Char( '$' ) ); }; { return KMacroExpander::expandMacros( s, relMap, QLatin1Char( '$' ) ); };
#else
auto expand = []( const QString& s ) -> QString { return s; };
#endif
// Massage the strings, images and style sections. // Massage the strings, images and style sections.
loadStrings( m_strings, doc, "strings", expand ); loadStrings( m_strings, doc, "strings", expand );
loadStrings( m_images, loadStrings( m_images,

View File

@ -57,7 +57,6 @@ calamares_add_library(calamaresui
SOVERSION ${CALAMARES_SOVERSION} SOVERSION ${CALAMARES_SOVERSION}
) )
target_link_libraries(calamaresui PRIVATE yamlcpp::yamlcpp) target_link_libraries(calamaresui PRIVATE yamlcpp::yamlcpp)
target_compile_definitions(calamaresui PRIVATE WITH_KOSRelease)
target_link_libraries(calamaresui PRIVATE ${kfname}::CoreAddons) target_link_libraries(calamaresui PRIVATE ${kfname}::CoreAddons)
if(WITH_QML) if(WITH_QML)

View File

@ -32,7 +32,6 @@ calamares_add_plugin(hostinfo
NO_CONFIG NO_CONFIG
) )
target_compile_definitions(calamares_job_hostinfo PRIVATE WITH_KOSRelease)
target_link_libraries(calamares_job_hostinfo PRIVATE ${kfname}::CoreAddons) target_link_libraries(calamares_job_hostinfo PRIVATE ${kfname}::CoreAddons)
calamares_add_test(hostinfotest SOURCES Tests.cpp HostInfoJob.cpp LIBRARIES yamlcpp::yamlcpp) calamares_add_test(hostinfotest SOURCES Tests.cpp HostInfoJob.cpp LIBRARIES yamlcpp::yamlcpp)

View File

@ -18,9 +18,7 @@
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#ifdef WITH_KOSRelease
#include <KOSRelease> #include <KOSRelease>
#endif
#ifdef Q_OS_FREEBSD #ifdef Q_OS_FREEBSD
#include <sys/types.h> #include <sys/types.h>
@ -56,13 +54,11 @@ hostOS()
QString QString
hostOSName() hostOSName()
{ {
#ifdef WITH_KOSRelease
KOSRelease r; KOSRelease r;
if ( !r.name().isEmpty() ) if ( !r.name().isEmpty() )
{ {
return r.name(); return r.name();
} }
#endif
return hostOS(); return hostOS();
} }