diff --git a/src/libcalamares/geoip/GeoIPFixed.cpp b/src/libcalamares/geoip/GeoIPFixed.cpp index 7e5efbd6c..6e8ef81c3 100644 --- a/src/libcalamares/geoip/GeoIPFixed.cpp +++ b/src/libcalamares/geoip/GeoIPFixed.cpp @@ -9,7 +9,7 @@ #include "GeoIPFixed.h" -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -32,4 +32,4 @@ GeoIPFixed::processReply( const QByteArray& data ) } } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares diff --git a/src/libcalamares/geoip/GeoIPFixed.h b/src/libcalamares/geoip/GeoIPFixed.h index d6e9b0e41..b1806309f 100644 --- a/src/libcalamares/geoip/GeoIPFixed.h +++ b/src/libcalamares/geoip/GeoIPFixed.h @@ -12,7 +12,7 @@ #include "Interface.h" -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -39,5 +39,5 @@ public: }; } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares #endif diff --git a/src/libcalamares/geoip/GeoIPJSON.cpp b/src/libcalamares/geoip/GeoIPJSON.cpp index c99cb55b6..36788176f 100644 --- a/src/libcalamares/geoip/GeoIPJSON.cpp +++ b/src/libcalamares/geoip/GeoIPJSON.cpp @@ -17,7 +17,7 @@ #include -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -89,4 +89,4 @@ GeoIPJSON::processReply( const QByteArray& data ) } } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares diff --git a/src/libcalamares/geoip/GeoIPJSON.h b/src/libcalamares/geoip/GeoIPJSON.h index e9be14102..3c226ff9e 100644 --- a/src/libcalamares/geoip/GeoIPJSON.h +++ b/src/libcalamares/geoip/GeoIPJSON.h @@ -12,7 +12,7 @@ #include "Interface.h" -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -40,5 +40,5 @@ public: }; } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares #endif diff --git a/src/libcalamares/geoip/GeoIPTests.cpp b/src/libcalamares/geoip/GeoIPTests.cpp index 00a03017a..4f3311db9 100644 --- a/src/libcalamares/geoip/GeoIPTests.cpp +++ b/src/libcalamares/geoip/GeoIPTests.cpp @@ -22,7 +22,7 @@ QTEST_GUILESS_MAIN( GeoIPTests ) -using namespace CalamaresUtils::GeoIP; +using namespace Calamares::GeoIP; GeoIPTests::GeoIPTests() {} @@ -86,7 +86,6 @@ GeoIPTests::testJSONbad() QCOMPARE( tz.first, QString() ); } - static const char xml_data_ubiquity[] = R"( 85.150.1.1 @@ -131,7 +130,6 @@ GeoIPTests::testXML2() #endif } - void GeoIPTests::testXMLalt() { @@ -163,7 +161,7 @@ GeoIPTests::testXMLbad() void GeoIPTests::testSplitTZ() { - using namespace CalamaresUtils::GeoIP; + using namespace Calamares::GeoIP; auto tz = splitTZString( QStringLiteral( "Moon/Dark_side" ) ); QCOMPARE( tz.first, QStringLiteral( "Moon" ) ); QCOMPARE( tz.second, QStringLiteral( "Dark_side" ) ); @@ -186,14 +184,13 @@ GeoIPTests::testSplitTZ() QCOMPARE( tz.second, QStringLiteral( "North_Dakota/Beulah" ) ); } - #define CHECK_GET( t, selector, 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(); \ + auto tz2 = Calamares::GeoIP::Handler( "" #t, url, selector ).get(); \ qDebug() << tz2; \ QCOMPARE( default_tz, tz2 ); \ } diff --git a/src/libcalamares/geoip/GeoIPXML.cpp b/src/libcalamares/geoip/GeoIPXML.cpp index 7f2c30090..42b945ed3 100644 --- a/src/libcalamares/geoip/GeoIPXML.cpp +++ b/src/libcalamares/geoip/GeoIPXML.cpp @@ -13,7 +13,7 @@ #include -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -59,7 +59,6 @@ getElementTexts( const QByteArray& data, const QString& tag ) return elements; } - QString GeoIPXML::rawReply( const QByteArray& data ) { @@ -90,4 +89,4 @@ GeoIPXML::processReply( const QByteArray& data ) } } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares diff --git a/src/libcalamares/geoip/GeoIPXML.h b/src/libcalamares/geoip/GeoIPXML.h index fb3167b24..313b931eb 100644 --- a/src/libcalamares/geoip/GeoIPXML.h +++ b/src/libcalamares/geoip/GeoIPXML.h @@ -12,7 +12,7 @@ #include "Interface.h" -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -40,5 +40,5 @@ public: }; } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares #endif diff --git a/src/libcalamares/geoip/Handler.cpp b/src/libcalamares/geoip/Handler.cpp index 14de9f39c..a6838c018 100644 --- a/src/libcalamares/geoip/Handler.cpp +++ b/src/libcalamares/geoip/Handler.cpp @@ -23,10 +23,10 @@ #include -static const NamedEnumTable< CalamaresUtils::GeoIP::Handler::Type >& +static const NamedEnumTable< Calamares::GeoIP::Handler::Type >& handlerTypes() { - using Type = CalamaresUtils::GeoIP::Handler::Type; + using Type = Calamares::GeoIP::Handler::Type; // *INDENT-OFF* // clang-format off @@ -42,7 +42,7 @@ handlerTypes() return names; } -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -142,7 +142,6 @@ Handler::get() const return do_query( m_type, m_url, m_selector ); } - QFuture< RegionZonePair > Handler::query() const { @@ -163,7 +162,6 @@ Handler::getRaw() const return do_raw_query( m_type, m_url, m_selector ); } - QFuture< QString > Handler::queryRaw() const { @@ -175,4 +173,4 @@ Handler::queryRaw() const } } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares diff --git a/src/libcalamares/geoip/Handler.h b/src/libcalamares/geoip/Handler.h index e13198b94..4b69612bc 100644 --- a/src/libcalamares/geoip/Handler.h +++ b/src/libcalamares/geoip/Handler.h @@ -16,7 +16,7 @@ #include #include -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -82,5 +82,5 @@ private: }; } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares #endif diff --git a/src/libcalamares/geoip/Interface.cpp b/src/libcalamares/geoip/Interface.cpp index 8ebe65208..ce6f5679f 100644 --- a/src/libcalamares/geoip/Interface.cpp +++ b/src/libcalamares/geoip/Interface.cpp @@ -12,7 +12,7 @@ #include "utils/Logger.h" #include "utils/String.h" -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -43,4 +43,4 @@ splitTZString( const QString& tz ) } } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares diff --git a/src/libcalamares/geoip/Interface.h b/src/libcalamares/geoip/Interface.h index dc9ef982f..eda2e43cc 100644 --- a/src/libcalamares/geoip/Interface.h +++ b/src/libcalamares/geoip/Interface.h @@ -19,7 +19,7 @@ class QByteArray; -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -98,5 +98,5 @@ protected: }; } // namespace GeoIP -} // namespace CalamaresUtils +} // namespace Calamares #endif diff --git a/src/libcalamares/geoip/test_geoip.cpp b/src/libcalamares/geoip/test_geoip.cpp index 0e14dcf91..40f63c30a 100644 --- a/src/libcalamares/geoip/test_geoip.cpp +++ b/src/libcalamares/geoip/test_geoip.cpp @@ -11,7 +11,6 @@ * This is a test-application that does one GeoIP parse. */ - #include "GeoIPFixed.h" #include "GeoIPJSON.h" #ifdef QT_XML_LIB @@ -23,7 +22,7 @@ #include using std::cerr; -using namespace CalamaresUtils::GeoIP; +using namespace Calamares::GeoIP; int main( int argc, char** argv ) diff --git a/src/modules/locale/Config.cpp b/src/modules/locale/Config.cpp index 8d6ff7e30..7b9f9f24a 100644 --- a/src/modules/locale/Config.cpp +++ b/src/modules/locale/Config.cpp @@ -245,7 +245,7 @@ Config::setCurrentLocation() void Config::setCurrentLocation( const QString& regionzone ) { - auto r = CalamaresUtils::GeoIP::splitTZString( regionzone ); + auto r = Calamares::GeoIP::splitTZString( regionzone ); if ( r.isValid() ) { setCurrentLocation( r.first, r.second ); @@ -459,23 +459,23 @@ getAdjustLiveTimezone( const QVariantMap& configurationMap, bool& adjustLiveTime } static inline void -getStartingTimezone( const QVariantMap& configurationMap, CalamaresUtils::GeoIP::RegionZonePair& startingTimezone ) +getStartingTimezone( const QVariantMap& configurationMap, Calamares::GeoIP::RegionZonePair& startingTimezone ) { QString region = CalamaresUtils::getString( configurationMap, "region" ); QString zone = CalamaresUtils::getString( configurationMap, "zone" ); if ( !region.isEmpty() && !zone.isEmpty() ) { - startingTimezone = CalamaresUtils::GeoIP::RegionZonePair( region, zone ); + startingTimezone = Calamares::GeoIP::RegionZonePair( region, zone ); } else { startingTimezone - = CalamaresUtils::GeoIP::RegionZonePair( QStringLiteral( "America" ), QStringLiteral( "New_York" ) ); + = Calamares::GeoIP::RegionZonePair( QStringLiteral( "America" ), QStringLiteral( "New_York" ) ); } if ( CalamaresUtils::getBool( configurationMap, "useSystemTimezone", false ) ) { - auto systemtz = CalamaresUtils::GeoIP::splitTZString( QTimeZone::systemTimeZoneId() ); + auto systemtz = Calamares::GeoIP::splitTZString( QTimeZone::systemTimeZoneId() ); if ( systemtz.isValid() ) { cDebug() << "Overriding configured timezone" << startingTimezone << "with system timezone" << systemtz; @@ -485,7 +485,7 @@ getStartingTimezone( const QVariantMap& configurationMap, CalamaresUtils::GeoIP: } static inline void -getGeoIP( const QVariantMap& configurationMap, std::unique_ptr< CalamaresUtils::GeoIP::Handler >& geoip ) +getGeoIP( const QVariantMap& configurationMap, std::unique_ptr< Calamares::GeoIP::Handler >& geoip ) { bool ok = false; QVariantMap map = CalamaresUtils::getSubMap( configurationMap, "geoip", ok ); @@ -495,7 +495,7 @@ getGeoIP( const QVariantMap& configurationMap, std::unique_ptr< CalamaresUtils:: QString style = CalamaresUtils::getString( map, "style" ); QString selector = CalamaresUtils::getString( map, "selector" ); - geoip = std::make_unique< CalamaresUtils::GeoIP::Handler >( style, url, selector ); + geoip = std::make_unique< Calamares::GeoIP::Handler >( style, url, selector ); if ( !geoip->isValid() ) { cWarning() << "GeoIP Style" << style << "is not recognized."; @@ -552,7 +552,7 @@ Config::startGeoIP() auto& network = CalamaresUtils::Network::Manager::instance(); if ( network.hasInternet() || network.synchronousPing( m_geoip->url() ) ) { - using Watcher = QFutureWatcher< CalamaresUtils::GeoIP::RegionZonePair >; + using Watcher = QFutureWatcher< Calamares::GeoIP::RegionZonePair >; m_geoipWatcher = std::make_unique< Watcher >(); m_geoipWatcher->setFuture( m_geoip->query() ); connect( m_geoipWatcher.get(), &Watcher::finished, this, &Config::completeGeoIP ); diff --git a/src/modules/locale/Config.h b/src/modules/locale/Config.h index 8e1ee5ca6..19f3467a1 100644 --- a/src/modules/locale/Config.h +++ b/src/modules/locale/Config.h @@ -171,19 +171,19 @@ private: * This may be overridden by setting *useSystemTimezone* or by * GeoIP settings. */ - CalamaresUtils::GeoIP::RegionZonePair m_startingTimezone; + Calamares::GeoIP::RegionZonePair m_startingTimezone; /** @brief Handler for GeoIP lookup (if configured) * * The GeoIP lookup needs to be started at some suitable time, * by explicitly calling *TODO* */ - std::unique_ptr< CalamaresUtils::GeoIP::Handler > m_geoip; + std::unique_ptr< Calamares::GeoIP::Handler > m_geoip; // Implementation details for doing GeoIP lookup void startGeoIP(); void completeGeoIP(); - std::unique_ptr< QFutureWatcher< CalamaresUtils::GeoIP::RegionZonePair > > m_geoipWatcher; + std::unique_ptr< QFutureWatcher< Calamares::GeoIP::RegionZonePair > > m_geoipWatcher; }; diff --git a/src/modules/welcome/Config.cpp b/src/modules/welcome/Config.cpp index 71020c4c0..17f37a091 100644 --- a/src/modules/welcome/Config.cpp +++ b/src/modules/welcome/Config.cpp @@ -329,7 +329,7 @@ setLanguageIcon( Config* c, const QVariantMap& configurationMap ) } static inline void -logGeoIPHandler( CalamaresUtils::GeoIP::Handler* handler ) +logGeoIPHandler( Calamares::GeoIP::Handler* handler ) { if ( handler ) { @@ -339,7 +339,7 @@ logGeoIPHandler( CalamaresUtils::GeoIP::Handler* handler ) } static void -setCountry( Config* config, const QString& countryCode, CalamaresUtils::GeoIP::Handler* handler ) +setCountry( Config* config, const QString& countryCode, Calamares::GeoIP::Handler* handler ) { if ( countryCode.length() != 2 ) { @@ -378,10 +378,10 @@ setGeoIP( Config* config, const QVariantMap& configurationMap ) { using FWString = QFutureWatcher< QString >; - auto* handler = new CalamaresUtils::GeoIP::Handler( CalamaresUtils::getString( geoip, "style" ), + auto* handler = new Calamares::GeoIP::Handler( CalamaresUtils::getString( geoip, "style" ), CalamaresUtils::getString( geoip, "url" ), CalamaresUtils::getString( geoip, "selector" ) ); - if ( handler->type() != CalamaresUtils::GeoIP::Handler::Type::None ) + if ( handler->type() != Calamares::GeoIP::Handler::Type::None ) { auto* future = new FWString(); QObject::connect( future, diff --git a/src/modules/welcome/WelcomeViewStep.h b/src/modules/welcome/WelcomeViewStep.h index effaafcf8..4f105ab11 100644 --- a/src/modules/welcome/WelcomeViewStep.h +++ b/src/modules/welcome/WelcomeViewStep.h @@ -23,7 +23,7 @@ class WelcomePage; class GeneralRequirements; class Config; -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -59,7 +59,7 @@ public: * the given 2-letter country code. Uses the handler's information (if * given) for error reporting. */ - void setCountry( const QString&, CalamaresUtils::GeoIP::Handler* handler ); + void setCountry( const QString&, Calamares::GeoIP::Handler* handler ); Calamares::RequirementsList checkRequirements() override; diff --git a/src/modules/welcomeq/WelcomeQmlViewStep.h b/src/modules/welcomeq/WelcomeQmlViewStep.h index 12beb4dde..dd63817b6 100644 --- a/src/modules/welcomeq/WelcomeQmlViewStep.h +++ b/src/modules/welcomeq/WelcomeQmlViewStep.h @@ -21,7 +21,7 @@ #include #include -namespace CalamaresUtils +namespace Calamares { namespace GeoIP { @@ -56,7 +56,7 @@ public: * the given 2-letter country code. Uses the handler's information (if * given) for error reporting. */ - void setCountry( const QString&, CalamaresUtils::GeoIP::Handler* handler ); + void setCountry( const QString&, Calamares::GeoIP::Handler* handler ); Calamares::RequirementsList checkRequirements() override; QObject* getConfig() override;