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
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"
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()
+++ /dev/null
-/* 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"
+++ /dev/null
-/* 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
+++ /dev/null
-[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