diff --git a/src/modules/locale/GeoIPJSON.cpp b/src/modules/locale/GeoIPJSON.cpp index aa5a2b411..b5cf40214 100644 --- a/src/modules/locale/GeoIPJSON.cpp +++ b/src/modules/locale/GeoIPJSON.cpp @@ -27,16 +27,10 @@ #include GeoIPJSON::GeoIPJSON(const QString& attribute) - : GeoIP( attribute ) + : GeoIP( attribute.isEmpty() ? QLatin1String( "time_zone" ) : attribute ) { } -GeoIPJSON::GeoIPJSON() - : GeoIPJSON( QLatin1Literal( "time_zone" ) ) -{ -} - - GeoIP::RegionZonePair GeoIPJSON::processReply( const QByteArray& data ) { diff --git a/src/modules/locale/GeoIPJSON.h b/src/modules/locale/GeoIPJSON.h index dbe1eeffa..3c08f577b 100644 --- a/src/modules/locale/GeoIPJSON.h +++ b/src/modules/locale/GeoIPJSON.h @@ -31,8 +31,12 @@ class GeoIPJSON : public GeoIP { public: - explicit GeoIPJSON( const QString& attribute ); - explicit GeoIPJSON(); + /** @brief Configure the attribute name which is selected. + * + * If an empty string is passed in (not a valid attribute name), + * then "time_zone" is used. + */ + explicit GeoIPJSON( const QString& attribute = QString() ); virtual RegionZonePair processReply( const QByteArray& ); } ; diff --git a/src/modules/locale/GeoIPXML.cpp b/src/modules/locale/GeoIPXML.cpp index a2117b2f2..a9aa43f76 100644 --- a/src/modules/locale/GeoIPXML.cpp +++ b/src/modules/locale/GeoIPXML.cpp @@ -24,16 +24,10 @@ #include GeoIPXML::GeoIPXML( const QString& element ) - : GeoIP( element ) + : GeoIP( element.isEmpty() ? QLatin1String( "TimeZone" ) : element ) { } -GeoIPXML::GeoIPXML() - : GeoIPXML( QLatin1Literal( "TimeZone" ) ) -{ -} - - GeoIP::RegionZonePair GeoIPXML::processReply( const QByteArray& data ) { diff --git a/src/modules/locale/GeoIPXML.h b/src/modules/locale/GeoIPXML.h index bda359485..bc3f23bec 100644 --- a/src/modules/locale/GeoIPXML.h +++ b/src/modules/locale/GeoIPXML.h @@ -31,10 +31,12 @@ class GeoIPXML : public GeoIP { public: - /** @brief Configure the element name which is selected. */ - explicit GeoIPXML( const QString& element ); - /** @brief Use default TimeZone element. */ - explicit GeoIPXML(); + /** @brief Configure the element tag which is selected. + * + * If an empty string is passed in (not a valid element tag), + * then "TimeZone" is used. + */ + explicit GeoIPXML( const QString& element = QString() ); virtual RegionZonePair processReply( const QByteArray& ); } ;