[locale] Make the selector configurable via the config file
This commit is contained in:
parent
b1b59b27b2
commit
352b385b12
@ -124,16 +124,16 @@ LocaleViewStep::fetchGeoIpTimezone()
|
|||||||
if ( m_geoipStyle.isEmpty() || m_geoipStyle == "legacy" )
|
if ( m_geoipStyle.isEmpty() || m_geoipStyle == "legacy" )
|
||||||
{
|
{
|
||||||
actualUrl.append( "/json/" );
|
actualUrl.append( "/json/" );
|
||||||
handler = new GeoIPJSON;
|
handler = new GeoIPJSON( m_geoipSelector );
|
||||||
}
|
}
|
||||||
else if ( m_geoipStyle == "json" )
|
else if ( m_geoipStyle == "json" )
|
||||||
{
|
{
|
||||||
handler = new GeoIPJSON;
|
handler = new GeoIPJSON( m_geoipSelector );
|
||||||
}
|
}
|
||||||
#if defined(HAVE_XML)
|
#if defined(HAVE_XML)
|
||||||
else if ( m_geoipStyle == "xml" )
|
else if ( m_geoipStyle == "xml" )
|
||||||
{
|
{
|
||||||
handler = new GeoIPXML;
|
handler = new GeoIPXML( m_geoipSelector );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
@ -295,4 +295,5 @@ LocaleViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
// Optional
|
// Optional
|
||||||
m_geoipUrl = CalamaresUtils::getString( configurationMap, "geoipUrl" );
|
m_geoipUrl = CalamaresUtils::getString( configurationMap, "geoipUrl" );
|
||||||
m_geoipStyle = CalamaresUtils::getString( configurationMap, "geoipStyle" );
|
m_geoipStyle = CalamaresUtils::getString( configurationMap, "geoipStyle" );
|
||||||
|
m_geoipSelector = CalamaresUtils::getString( configurationMap, "geoipSelector" );
|
||||||
}
|
}
|
||||||
|
@ -75,8 +75,10 @@ private:
|
|||||||
|
|
||||||
QPair< QString, QString > m_startingTimezone;
|
QPair< QString, QString > m_startingTimezone;
|
||||||
QString m_localeGenPath;
|
QString m_localeGenPath;
|
||||||
QString m_geoipUrl;
|
|
||||||
QString m_geoipStyle;
|
QString m_geoipUrl; // The URL, depening on style might be modified on lookup
|
||||||
|
QString m_geoipStyle; // String selecting which kind of geoip data to expect
|
||||||
|
QString m_geoipSelector; // String selecting data from the geoip lookup
|
||||||
|
|
||||||
QList< Calamares::job_ptr > m_jobs;
|
QList< Calamares::job_ptr > m_jobs;
|
||||||
};
|
};
|
||||||
|
@ -37,7 +37,9 @@ zone: "New_York"
|
|||||||
# the URL may be modified before use. The request should return
|
# the URL may be modified before use. The request should return
|
||||||
# valid data in a suitable format, depending on geoipStyle;
|
# valid data in a suitable format, depending on geoipStyle;
|
||||||
# generally this includes a string value with the timezone
|
# generally this includes a string value with the timezone
|
||||||
# in <region>/<zone> format.
|
# in <region>/<zone> format. For services that return data which
|
||||||
|
# does not follow the conventions of "suitable data" described
|
||||||
|
# below, *geoIPSelector* may be used to pick different data.
|
||||||
#
|
#
|
||||||
# Note that this example URL works, but the service is shutting
|
# Note that this example URL works, but the service is shutting
|
||||||
# down in June 2018.
|
# down in June 2018.
|
||||||
@ -68,3 +70,12 @@ zone: "New_York"
|
|||||||
# shutting down in June 2018. There are other providers with the same
|
# shutting down in June 2018. There are other providers with the same
|
||||||
# format. XML format is provided for Ubiquity.
|
# format. XML format is provided for Ubiquity.
|
||||||
#geoipStyle: "legacy"
|
#geoipStyle: "legacy"
|
||||||
|
|
||||||
|
# GeoIP selector. Leave commented out for the default selector
|
||||||
|
# (which depends on the style: JSON uses "time_zone" and XML
|
||||||
|
# uses TimeZone, for the FreeGeoIP-alike and the Ubiquity-alike
|
||||||
|
# respectively). If the service configured via *geoipUrl* uses
|
||||||
|
# a different attribute name (e.g. "timezone") in JSON or a
|
||||||
|
# different element tag (e.g. "<Time_Zone>") in XML, set this
|
||||||
|
# string to the name or tag to be used.
|
||||||
|
#geoipSelector: ""
|
||||||
|
Loading…
Reference in New Issue
Block a user