From bf3d3c88679ded818521adafd8a7b7ceeccc422d Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 26 Apr 2022 06:59:05 +0300 Subject: [PATCH] plasma: do not emit useless data from hostip geolocation provider Signed-off-by: Ivailo Monev --- plasma/dataengines/geolocation/location_hostip.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plasma/dataengines/geolocation/location_hostip.cpp b/plasma/dataengines/geolocation/location_hostip.cpp index f5c0c201..164084b3 100644 --- a/plasma/dataengines/geolocation/location_hostip.cpp +++ b/plasma/dataengines/geolocation/location_hostip.cpp @@ -55,6 +55,17 @@ public: } } } + + if (country.contains(QLatin1String("Unknown Country"))) { + country = QString(); + } + if (city.contains(QLatin1String("Unknown City"))) { + city = QString(); + } + if (country.isEmpty() && city.isEmpty()) { + return; + } + // ordering of first three to preserve backwards compatibility outd["accuracy"] = 40000; outd["country"] = country; -- 2.11.0