From 88fc6685ba1037664c429b34421d28be3850c5d3 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 4 Sep 2019 09:19:00 -0400 Subject: [PATCH] [libcalamares] Apply coding style to geoip/ --- src/libcalamares/geoip/GeoIPTests.cpp | 6 ++++-- src/libcalamares/geoip/GeoIPXML.cpp | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcalamares/geoip/GeoIPTests.cpp b/src/libcalamares/geoip/GeoIPTests.cpp index 3400bb24f..4b1f8f8e1 100644 --- a/src/libcalamares/geoip/GeoIPTests.cpp +++ b/src/libcalamares/geoip/GeoIPTests.cpp @@ -197,7 +197,8 @@ GeoIPTests::testSplitTZ() #define CHECK_GET( t, selector, url ) \ { \ - auto tz = GeoIP##t( selector ).processReply( CalamaresUtils::Network::Manager::instance().synchronousGet( QUrl( url ) ) ); \ + auto tz = GeoIP##t( selector ) \ + .processReply( CalamaresUtils::Network::Manager::instance().synchronousGet( QUrl( url ) ) ); \ qDebug() << tz; \ QCOMPARE( default_tz, tz ); \ auto tz2 = CalamaresUtils::GeoIP::Handler( "" #t, url, selector ).get(); \ @@ -216,7 +217,8 @@ GeoIPTests::testGet() GeoIPJSON default_handler; // Call the KDE service the definitive source. - auto default_tz = default_handler.processReply( CalamaresUtils::Network::Manager::instance().synchronousGet( QUrl( "https://geoip.kde.org/v1/calamares" ) ) ); + auto default_tz = default_handler.processReply( + CalamaresUtils::Network::Manager::instance().synchronousGet( QUrl( "https://geoip.kde.org/v1/calamares" ) ) ); // This is bogus, because the test isn't always run by me // QCOMPARE( default_tz.first, QStringLiteral("Europe") ); diff --git a/src/libcalamares/geoip/GeoIPXML.cpp b/src/libcalamares/geoip/GeoIPXML.cpp index 256e774cf..2a97c5546 100644 --- a/src/libcalamares/geoip/GeoIPXML.cpp +++ b/src/libcalamares/geoip/GeoIPXML.cpp @@ -73,10 +73,12 @@ QString GeoIPXML::rawReply( const QByteArray& data ) { for ( const auto& e : getElementTexts( data, m_element ) ) + { if ( !e.isEmpty() ) { return e; } + } return QString(); }