Commit 88c8e4b0 authored by Méven Car's avatar Méven Car
Browse files

[dataengine/geolocation] Use logging category in location_ip.cpp

Reviewers: #plasma, apol, crossi, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26081
parent 24f75b2f
......@@ -50,6 +50,7 @@ install(FILES plasma-geolocationprovider.desktop DESTINATION ${KDE_INSTALL_KSERV
# -------------------------------------------------------------------------------------------------
set(plasma_geolocation_ip_SRCS location_ip.cpp)
ecm_qt_declare_logging_category(plasma_geolocation_ip_SRCS HEADER geolocdebug.h IDENTIFIER DATAENGINE_GEOLOCATION CATEGORY_NAME org.kde.plasma.dataengine.geolocation)
add_library(plasma-geolocation-ip MODULE ${plasma_geolocation_ip_SRCS})
target_compile_definitions(plasma-geolocation-ip PRIVATE -DQT_NO_KEYWORDS)
target_link_libraries(plasma-geolocation-ip plasma-geolocation-interface KF5::KIOCore KF5::NetworkManagerQt)
......
......@@ -20,7 +20,7 @@
*/
#include "location_ip.h"
#include <QDebug>
#include "geolocdebug.h"
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
......@@ -41,7 +41,7 @@ public:
{
m_geoLocationResolved = true;
if (job && job->error()) {
qDebug() << "error" << job->errorString();
qCCritical(DATAENGINE_GEOLOCATION) << "error: " << job->errorString();
m_geoLocationPayload.clear();
checkUpdateData();
return;
......@@ -94,7 +94,7 @@ public:
void readCountry(KJob *job) {
m_countryResolved = true;
if (job && job->error()) {
qDebug() << "error" << job->errorString();
qCCritical(DATAENGINE_GEOLOCATION) << "error: " << job->errorString();
m_countryPayload.clear();
checkUpdateData();
return;
......@@ -180,7 +180,7 @@ void Ip::update()
KIO::HideProgressInfo);
datajob->addMetaData(QStringLiteral("content-type"), QStringLiteral("application/json"));
qDebug() << "Fetching https://location.services.mozilla.com/v1/geolocate";
qCDebug(DATAENGINE_GEOLOCATION) << "Fetching https://location.services.mozilla.com/v1/geolocate";
connect(datajob, &KIO::TransferJob::data, d, &Ip::Private::geoLocationData);
connect(datajob, &KIO::TransferJob::result, d, &Ip::Private::readGeoLocation);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment