From 15cd9c66875e69f116f54063ba454274991bd0a0 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 25 Apr 2022 10:47:04 +0300 Subject: [PATCH] plasma: drop GeoClue provider for geolocation data engine Signed-off-by: Ivailo Monev --- CMakeLists.txt | 8 --- appveyor.yml | 2 +- plasma/dataengines/geolocation/CMakeLists.txt | 12 ---- .../dataengines/geolocation/location_geoclue.cpp | 71 ---------------------- plasma/dataengines/geolocation/location_geoclue.h | 34 ----------- .../geolocation/plasma-geolocation-geoclue.desktop | 9 --- 6 files changed, 1 insertion(+), 135 deletions(-) delete mode 100644 plasma/dataengines/geolocation/location_geoclue.cpp delete mode 100644 plasma/dataengines/geolocation/location_geoclue.h delete mode 100644 plasma/dataengines/geolocation/plasma-geolocation-geoclue.desktop diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d96fcbd..e25afbd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,14 +235,6 @@ set_package_properties(LightDM PROPERTIES PURPOSE "Needed for the LightDM greeter" ) -macro_optional_find_package(GeoClue) -set_package_properties(GeoClue PROPERTIES - DESCRIPTION "D-Bus service that provides location information" - URL "https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home" - PURPOSE "Geo location via GeoClue" - TYPE OPTIONAL -) - find_program(WRESTOOL_EXECUTABLE wrestool) add_feature_info(wrestool WRESTOOL_EXECUTABLE diff --git a/appveyor.yml b/appveyor.yml index 02bc5817..5a923429 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,7 +26,7 @@ build_script: libglu1-mesa-dev mesa-common-dev libmtp-dev libusb-1.0-0-dev libssh-dev \ libsmbclient-dev libdrm-dev libraw1394-dev libsensors4-dev \ libegl-dev libpci-dev libopenexr-dev liblzma-dev libbz2-dev libgphoto2-dev \ - liblightdm-gobject-1-dev libgeoclue-2-dev libdbusmenu-katie ccache + liblightdm-gobject-1-dev libdbusmenu-katie ccache export PATH="/usr/lib/ccache/:$PATH" diff --git a/plasma/dataengines/geolocation/CMakeLists.txt b/plasma/dataengines/geolocation/CMakeLists.txt index 6e7bc3ec..acfc912a 100644 --- a/plasma/dataengines/geolocation/CMakeLists.txt +++ b/plasma/dataengines/geolocation/CMakeLists.txt @@ -68,15 +68,3 @@ kde4_add_plugin(plasma-geolocation-geoplugin ${plasma_geolocation_geoplugin_SRCS target_link_libraries(plasma-geolocation-geoplugin plasma-geolocation-interface) install(FILES plasma-geolocation-geoplugin.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR}) install(TARGETS plasma-geolocation-geoplugin DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}) - -# ------------------------------------------------------------------------------------------------- - -if (GEOCLUE_FOUND) - include_directories(${GEOCLUE_INCLUDES}) - - set(plasma_geolocation_geoclue_SRCS location_geoclue.cpp) - kde4_add_plugin(plasma-geolocation-geoclue ${plasma_geolocation_geoclue_SRCS}) - target_link_libraries(plasma-geolocation-geoclue plasma-geolocation-interface ${GEOCLUE_LIBRARIES}) - install(FILES plasma-geolocation-geoclue.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR}) - install(TARGETS plasma-geolocation-geoclue DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}) -endif() diff --git a/plasma/dataengines/geolocation/location_geoclue.cpp b/plasma/dataengines/geolocation/location_geoclue.cpp deleted file mode 100644 index 66e599fa..00000000 --- a/plasma/dataengines/geolocation/location_geoclue.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2022 Ivailo Monev - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2, as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#define QT_NO_KEYWORDS - -#include "location_geoclue.h" - -#include - -#include - - -GeoClue::GeoClue(QObject* parent, const QVariantList& args) - : GeolocationProvider(parent, args) -{ - setUpdateTriggers(GeolocationProvider::SourceEvent | GeolocationProvider::NetworkConnected); -} - -GeoClue::~GeoClue() -{ -} - -void GeoClue::update() -{ - Plasma::DataEngine::Data enginedata; - setData(enginedata); - - GError *gliberror = NULL; - GClueSimple* gcluesimple = gclue_simple_new_sync("location_geoclue", GCLUE_ACCURACY_LEVEL_CITY, NULL, &gliberror); - if (!gcluesimple) { - kWarning() << "Null GClueSimple pointer"; - return; - } else if (gliberror != NULL) { - kWarning() << gliberror->message; - return; - } - - GClueLocation* gcluelocation = gclue_simple_get_location(gcluesimple); - if (!gcluelocation) { - kWarning() << "Null GClueLocation pointer"; - return; - } - - // qDebug() << Q_FUNC_INFO << gclue_location_get_description(gcluelocation); - // qDebug() << Q_FUNC_INFO << gclue_location_get_accuracy(gcluelocation); - // qDebug() << Q_FUNC_INFO << gclue_location_get_latitude(gcluelocation) - // qDebug() << Q_FUNC_INFO << gclue_location_get_longitude(gcluelocation); - enginedata["accuracy"] = qRound(qreal(gclue_location_get_accuracy(gcluelocation))); - enginedata["latitude"] = qreal(gclue_location_get_latitude(gcluelocation)); - enginedata["longitude"] = qreal(gclue_location_get_longitude(gcluelocation)); - setData(enginedata); -} - -K_EXPORT_PLASMA_GEOLOCATIONPROVIDER(geoclue, GeoClue) - -#include "moc_location_geoclue.cpp" diff --git a/plasma/dataengines/geolocation/location_geoclue.h b/plasma/dataengines/geolocation/location_geoclue.h deleted file mode 100644 index 58c16052..00000000 --- a/plasma/dataengines/geolocation/location_geoclue.h +++ /dev/null @@ -1,34 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2022 Ivailo Monev - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2, as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef LOCATION_GEOCLUE_H -#define LOCATION_GEOCLUE_H - -#include "geolocationprovider.h" - -class GeoClue : public GeolocationProvider -{ - Q_OBJECT -public: - explicit GeoClue(QObject *parent = 0, const QVariantList &args = QVariantList()); - ~GeoClue(); - - virtual void update(); -}; - -#endif // LOCATION_GEOCLUE_H diff --git a/plasma/dataengines/geolocation/plasma-geolocation-geoclue.desktop b/plasma/dataengines/geolocation/plasma-geolocation-geoclue.desktop deleted file mode 100644 index ffa16e1b..00000000 --- a/plasma/dataengines/geolocation/plasma-geolocation-geoclue.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Name=Geolocation GeoClue -Comment=Geolocation via GeoClue. -X-KDE-ServiceTypes=Plasma/GeolocationProvider -X-KDE-ParentApp=geolocation -Type=Service -Icon=applications-internet -X-KDE-Library=plasma-geolocation-geoclue -X-KDE-PluginInfo-Name=geoclue -- 2.11.0