[libcalamares] Drop alternate-config handling for GeoIP

- Dealing with legacy formats and alternate configurations
   is something that consumers should do (and then hand off
   to the 3-string constructor) instead.
main
Adriaan de Groot 6 years ago
parent fc76313ea6
commit 44cbb0d374

@ -74,19 +74,10 @@ Handler::Handler( const QString& implementation, const QString& url, const QStri
}
}
static QString
getMapAlternates( const QVariantMap& config, const QString& key1, const QString& key2 )
{
QString r = CalamaresUtils::getString( config, key1 );
if ( r.isEmpty() )
r = CalamaresUtils::getString( config, key2 );
return r;
}
Handler::Handler( const QVariantMap& config )
: Handler( getMapAlternates( config, QStringLiteral( "style" ), QStringLiteral( "geoipStyle" ) ),
getMapAlternates( config, QStringLiteral( "url" ), QStringLiteral( "geoipUrl" ) ),
getMapAlternates( config, QStringLiteral( "selector" ), QStringLiteral( "geoipSelector" ) ) )
: Handler( CalamaresUtils::getString( config, QStringLiteral( "style" ) ),
CalamaresUtils::getString( config, QStringLiteral( "url" ) ),
CalamaresUtils::getString( config, QStringLiteral( "selector" ) ) )
{
}

@ -61,9 +61,9 @@ public:
* This is like the 3-QString Handler constructor, except the strings
* are extracted from the map, which is typically part of the configuration
* of a Calamares module. The strings are fetched from these keys:
* - implementation from "style" or "geoipStyle" (if the first does not exist)
* - url from "url" or "geoipUrl" (if the first does not exist)
* - selector from "selector" or "geoipSelector" (if the first does not exist)
* - implementation from "style"
* - url from "url"
* - selector from "selector"
*/
Handler( const QVariantMap& config );

Loading…
Cancel
Save