diff --git a/src/modules/locale/GeoIP.cpp b/src/modules/locale/GeoIP.cpp index d20d398c7..5ada6e10c 100644 --- a/src/modules/locale/GeoIP.cpp +++ b/src/modules/locale/GeoIP.cpp @@ -21,9 +21,3 @@ GeoIP::~GeoIP() { } - -QUrl -GeoIP::fullUrl(const QString& configUrl) -{ - return QUrl::fromUserInput( configUrl ); -} diff --git a/src/modules/locale/GeoIP.h b/src/modules/locale/GeoIP.h index 6d4992781..f05c4d383 100644 --- a/src/modules/locale/GeoIP.h +++ b/src/modules/locale/GeoIP.h @@ -36,16 +36,6 @@ struct GeoIP { using RegionZonePair = QPair; - /** @brief Convert configured URL to a complete URL. - * - * Some GeoIP providers are configured with one URL, but actually - * do retrieval with another (e.g. when using the original - * implementation of FreeGeoIP, or when adding an API key). - * - * The default implementation uses the @p configUrl unchanged. - */ - virtual QUrl fullUrl( const QString& configUrl ); - /** @brief Handle a (successful) request by interpreting the data. * * Should return a ( , ) pair, e.g. diff --git a/src/modules/locale/GeoIPFreeGeoIP.cpp b/src/modules/locale/GeoIPFreeGeoIP.cpp index be77dc2e4..354e6c011 100644 --- a/src/modules/locale/GeoIPFreeGeoIP.cpp +++ b/src/modules/locale/GeoIPFreeGeoIP.cpp @@ -26,15 +26,6 @@ #include -QUrl -FreeGeoIP::fullUrl( const QString& configUrl ) -{ - // FIXME: derpy way to append "/json" to the user-specified config URL - QString requestUrl = QString( "%1/json" ) - .arg( QUrl::fromUserInput( configUrl ).toString() ); - return QUrl( requestUrl ); -} - GeoIP::RegionZonePair FreeGeoIP::processReply( QNetworkReply* reply ) { diff --git a/src/modules/locale/GeoIPFreeGeoIP.h b/src/modules/locale/GeoIPFreeGeoIP.h index 3fe6157a2..474ce8496 100644 --- a/src/modules/locale/GeoIPFreeGeoIP.h +++ b/src/modules/locale/GeoIPFreeGeoIP.h @@ -21,9 +21,16 @@ #include "GeoIP.h" +/** @brief GeoIP lookup via freegeoip.com + * + * This is the original implementation of GeoIP lookup, + * using the FreeGeoIP service, or similar which returns + * data in the same format. + * + * The data is assumed to be in JSON format with a time_zone attribute. + */ struct FreeGeoIP : public GeoIP { - virtual QUrl fullUrl( const QString& configUrl ); virtual RegionZonePair processReply( QNetworkReply* ); } ; diff --git a/src/modules/locale/LocaleViewStep.cpp b/src/modules/locale/LocaleViewStep.cpp index bd9bef2fe..7eaaebbf8 100644 --- a/src/modules/locale/LocaleViewStep.cpp +++ b/src/modules/locale/LocaleViewStep.cpp @@ -133,7 +133,7 @@ LocaleViewStep::fetchGeoIpTimezone() } ); QNetworkRequest request; - request.setUrl( handler->fullUrl( m_geoipUrl ) ); + request.setUrl( QUrl::fromUserInput( m_geoipUrl ) ); request.setAttribute( QNetworkRequest::FollowRedirectsAttribute, true ); manager->get( request ); }