OSDN Git Service

plasma: drop GeoClue provider for geolocation data engine
authorIvailo Monev <xakepa10@gmail.com>
Mon, 25 Apr 2022 07:47:04 +0000 (10:47 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 25 Apr 2022 07:47:04 +0000 (10:47 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
CMakeLists.txt
appveyor.yml
plasma/dataengines/geolocation/CMakeLists.txt
plasma/dataengines/geolocation/location_geoclue.cpp [deleted file]
plasma/dataengines/geolocation/location_geoclue.h [deleted file]
plasma/dataengines/geolocation/plasma-geolocation-geoclue.desktop [deleted file]

index 4d96fcb..e25afbd 100644 (file)
@@ -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
index 02bc581..5a92342 100644 (file)
@@ -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"
 
index 6e7bc3e..acfc912 100644 (file)
@@ -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 (file)
index 66e599f..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*  This file is part of the KDE project
-    Copyright (C) 2022 Ivailo Monev <xakepa10@gmail.com>
-
-    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 <KDebug>
-
-#include <libgeoclue-2.0/gclue-simple.h>
-
-
-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 (file)
index 58c1605..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*  This file is part of the KDE project
-    Copyright (C) 2022 Ivailo Monev <xakepa10@gmail.com>
-
-    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 (file)
index ffa16e1..0000000
+++ /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