From 47b7040897a7972ab9d9b8f67dbd08ee1eb3f42b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 13 Apr 2018 09:24:59 -0400 Subject: [PATCH] [locale] Adjust to Calamares 3.2 idiom --- src/modules/locale/GeoIPXML.cpp | 2 +- src/modules/locale/LocaleViewStep.cpp | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/modules/locale/GeoIPXML.cpp b/src/modules/locale/GeoIPXML.cpp index f6b3ff342..a0f9b7a2d 100644 --- a/src/modules/locale/GeoIPXML.cpp +++ b/src/modules/locale/GeoIPXML.cpp @@ -42,7 +42,7 @@ XMLGeoIP::processReply( const QByteArray& data ) } else { - cDebug() << "GeoIP XML data error:" << domError << "(line" << errorLine << errorColumn << ')'; + cWarning() << "GeoIP XML data error:" << domError << "(line" << errorLine << errorColumn << ')'; } return qMakePair( QString(), QString() ); diff --git a/src/modules/locale/LocaleViewStep.cpp b/src/modules/locale/LocaleViewStep.cpp index 6da0b3367..76e89babb 100644 --- a/src/modules/locale/LocaleViewStep.cpp +++ b/src/modules/locale/LocaleViewStep.cpp @@ -31,6 +31,7 @@ #include "timezonewidget/localeglobal.h" #include "widgets/WaitingWidget.h" +#include "utils/CalamaresUtils.h" #include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" #include "utils/YamlUtils.h" @@ -137,7 +138,7 @@ LocaleViewStep::fetchGeoIpTimezone() #endif else { - cDebug() << "WARNING: GeoIP Style" << m_geoipStyle << "is not recognized."; + cWarning() << "GeoIP Style" << m_geoipStyle << "is not recognized."; setUpPage(); return; } @@ -289,16 +290,6 @@ LocaleViewStep::setConfigurationMap( const QVariantMap& configurationMap ) } // Optional - if ( configurationMap.contains( "geoipUrl" ) && - configurationMap.value( "geoipUrl" ).type() == QVariant::String && - !configurationMap.value( "geoipUrl" ).toString().isEmpty() ) - { - m_geoipUrl = configurationMap.value( "geoipUrl" ).toString(); - } - if ( configurationMap.contains( "geoipStyle" ) && - configurationMap.value( "geoipStyle" ).type() == QVariant::String && - !configurationMap.value( "geoipStyle" ).toString().isEmpty() ) - { - m_geoipStyle = configurationMap.value( "geoipStyle" ).toString(); - } + m_geoipUrl = CalamaresUtils::getString( configurationMap, "geoipUrl" ); + m_geoipStyle = CalamaresUtils::getString( configurationMap, "geoipStyle" ); }