[libcalamares] Drop unnecessary HAVE_XML
- Linking to QtXml gives us a -DQT_XML_LIB already, so use that.
This commit is contained in:
parent
a1b1ebcd29
commit
ce909f00cc
@ -79,7 +79,6 @@ find_package(Qt5 COMPONENTS Xml)
|
||||
if( Qt5Xml_FOUND )
|
||||
list( APPEND geoipSources geoip/GeoIPXML.cpp )
|
||||
list( APPEND geoip_libs Qt5::Network Qt5::Xml )
|
||||
add_definitions( -DHAVE_XML )
|
||||
endif()
|
||||
|
||||
add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} ${geoipSources} )
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "GeoIPTests.h"
|
||||
|
||||
#include "GeoIPJSON.h"
|
||||
#ifdef HAVE_XML
|
||||
#ifdef QT_XML_LIB
|
||||
#include "GeoIPXML.h"
|
||||
#endif
|
||||
|
||||
@ -118,7 +118,7 @@ static const char xml_data_ubiquity[] =
|
||||
void
|
||||
GeoIPTests::testXML()
|
||||
{
|
||||
#ifdef HAVE_XML
|
||||
#ifdef QT_XML_LIB
|
||||
GeoIPXML handler;
|
||||
auto tz = handler.processReply( xml_data_ubiquity );
|
||||
|
||||
@ -133,7 +133,7 @@ GeoIPTests::testXML2()
|
||||
static const char data[] =
|
||||
"<Response><TimeZone>America/North Dakota/Beulah</TimeZone></Response>"; // With a space!
|
||||
|
||||
#ifdef HAVE_XML
|
||||
#ifdef QT_XML_LIB
|
||||
GeoIPXML handler;
|
||||
auto tz = handler.processReply( data );
|
||||
|
||||
@ -145,7 +145,7 @@ GeoIPTests::testXML2()
|
||||
|
||||
void GeoIPTests::testXMLalt()
|
||||
{
|
||||
#ifdef HAVE_XML
|
||||
#ifdef QT_XML_LIB
|
||||
GeoIPXML handler( "ZT" );
|
||||
|
||||
auto tz = handler.processReply( "<A><B/><C><ZT>Moon/Dark_side</ZT></C></A>" );
|
||||
@ -157,7 +157,7 @@ void GeoIPTests::testXMLalt()
|
||||
void
|
||||
GeoIPTests::testXMLbad()
|
||||
{
|
||||
#ifdef HAVE_XML
|
||||
#ifdef QT_XML_LIB
|
||||
GeoIPXML handler;
|
||||
auto tz = handler.processReply( "{time_zone: \"Europe/Paris\"}" );
|
||||
QCOMPARE( tz.first, QString() );
|
||||
@ -249,7 +249,7 @@ void GeoIPTests::testGet()
|
||||
|
||||
CHECK_GET( JSON, QStringLiteral("Location.TimeZone"), "https://geoip.kde.org/debug" ) // 2-level JSON
|
||||
|
||||
#ifdef HAVE_XML
|
||||
#ifdef QT_XML_LIB
|
||||
CHECK_GET( XML, QString(), "http://geoip.ubuntu.com/lookup" ) // Ubiquity's XML format
|
||||
CHECK_GET( XML, QString(), "https://geoip.kde.org/v1/ubiquity" ) // Temporary KDE service
|
||||
#endif
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "GeoIPJSON.h"
|
||||
#ifdef HAVE_XML
|
||||
#ifdef QT_XML_LIB
|
||||
#include "GeoIPXML.h"
|
||||
#endif
|
||||
|
||||
@ -40,7 +40,7 @@ int main(int argc, char** argv)
|
||||
GeoIP* handler = nullptr;
|
||||
if ( QStringLiteral( "json" ) == argv[1] )
|
||||
handler = new GeoIPJSON;
|
||||
#ifdef HAVE_XML
|
||||
#ifdef QT_XML_LIB
|
||||
else if ( QStringLiteral( "xml" ) == argv[1] )
|
||||
handler = new GeoIPXML;
|
||||
#endif
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "geoip/GeoIP.h"
|
||||
#include "geoip/GeoIPJSON.h"
|
||||
#ifdef HAVE_XML
|
||||
#ifdef QT_XML_LIB
|
||||
#include "geoip/GeoIPXML.h"
|
||||
#endif
|
||||
|
||||
@ -129,7 +129,7 @@ LocaleViewStep::fetchGeoIpTimezone()
|
||||
{
|
||||
handler = new GeoIPJSON( m_geoipSelector );
|
||||
}
|
||||
#if defined(HAVE_XML)
|
||||
#if defined(QT_XML_LIB)
|
||||
else if ( m_geoipStyle == "xml" )
|
||||
{
|
||||
handler = new GeoIPXML( m_geoipSelector );
|
||||
|
Loading…
Reference in New Issue
Block a user