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

View File

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

View File

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

View File

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