mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
plasma: remove GPS geolocation provider
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5017f8065b
commit
4b22123986
6 changed files with 1 additions and 358 deletions
|
@ -152,14 +152,6 @@ set_package_properties(Fontconfig PROPERTIES
|
|||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
macro_optional_find_package(LibGPS)
|
||||
set_package_properties(LibGPS PROPERTIES
|
||||
DESCRIPTION "GPSes/AIS service library"
|
||||
URL "http://www.catb.org/gpsd/"
|
||||
PURPOSE "GPS support for geolocation in plasma dataengine"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
macro_optional_find_package(LibKonq)
|
||||
set_package_properties(LibKonq PROPERTIES
|
||||
DESCRIPTION "Konqueror library"
|
||||
|
|
|
@ -25,7 +25,7 @@ build_script:
|
|||
libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-image0-dev \
|
||||
libxcb-render-util0-dev libxcb-keysyms1-dev libxcb-xtest0-dev \
|
||||
libxcb-record0-dev libglu1-mesa-dev mesa-common-dev libmtp-dev python \
|
||||
libgps-dev libusb-1.0-0-dev libssh-dev libsmbclient-dev perl-base \
|
||||
libusb-1.0-0-dev libssh-dev libsmbclient-dev perl-base \
|
||||
libdrm-dev libraw1394-dev libsensors4-dev libgles2-mesa-dev libpam0g-dev \
|
||||
libpci-dev libopenexr-dev liblzma-dev libbz2-dev libjpeg-dev \
|
||||
libgphoto2-dev libdbusmenu-katie ccache
|
||||
|
|
|
@ -54,14 +54,3 @@ install(FILES plasma-geolocation-ip.desktop DESTINATION ${KDE4_SERVICES_INSTALL_
|
|||
install(TARGETS plasma-geolocation-ip DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
if(LIBGPS_FOUND)
|
||||
include_directories(${LIBGPS_INCLUDES} ${LIBGPS_INCLUDE_DIR})
|
||||
set(plasma_geolocation_gps_SRCS location_gps.cpp)
|
||||
kde4_add_plugin(plasma-geolocation-gps ${plasma_geolocation_gps_SRCS})
|
||||
target_link_libraries(plasma-geolocation-gps plasma-geolocation-interface ${LIBGPS_LIBRARIES})
|
||||
install(FILES plasma-geolocation-gps.desktop DESTINATION ${KDE4_SERVICES_INSTALL_DIR})
|
||||
install(TARGETS plasma-geolocation-gps DESTINATION ${KDE4_PLUGIN_INSTALL_DIR})
|
||||
endif(LIBGPS_FOUND)
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,129 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Petri Damstén <damu@iki.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "location_gps.h"
|
||||
#include <kdebug.h>
|
||||
|
||||
Gpsd::Gpsd(gps_data_t* gpsdata)
|
||||
: m_gpsdata(gpsdata)
|
||||
, m_abort(false)
|
||||
{
|
||||
}
|
||||
|
||||
Gpsd::~Gpsd()
|
||||
{
|
||||
m_abort = true;
|
||||
m_condition.wakeOne();
|
||||
wait();
|
||||
}
|
||||
|
||||
void Gpsd::update()
|
||||
{
|
||||
if (!isRunning()) {
|
||||
start();
|
||||
} else {
|
||||
m_condition.wakeOne();
|
||||
}
|
||||
}
|
||||
|
||||
void Gpsd::run()
|
||||
{
|
||||
#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 3 ) && defined( WATCH_ENABLE )
|
||||
gps_stream(m_gpsdata, WATCH_ENABLE, NULL);
|
||||
#else
|
||||
gps_query(m_gpsdata, "w+x\n");
|
||||
#endif
|
||||
|
||||
while (!m_abort) {
|
||||
Plasma::DataEngine::Data d;
|
||||
|
||||
#if GPSD_API_MAJOR_VERSION >= 7
|
||||
if (gps_read(m_gpsdata, NULL, 0) != -1) {
|
||||
#elif GPSD_API_MAJOR_VERSION >= 5
|
||||
if (gps_read(m_gpsdata) != -1) {
|
||||
#else
|
||||
if (gps_poll(m_gpsdata) != -1) {
|
||||
#endif
|
||||
//kDebug() << "poll ok";
|
||||
#if GPSD_API_MAJOR_VERSION >= 9
|
||||
if (m_gpsdata->online.tv_sec >= 0 && m_gpsdata->online.tv_nsec >= 0) {
|
||||
#else
|
||||
if (m_gpsdata->online) {
|
||||
#endif
|
||||
//kDebug() << "online";
|
||||
#if GPSD_API_MAJOR_VERSION >= 10
|
||||
if (m_gpsdata->fix.status != STATUS_NO_FIX) {
|
||||
#else
|
||||
if (m_gpsdata->status != STATUS_NO_FIX) {
|
||||
#endif
|
||||
//kDebug() << "fix";
|
||||
d["accuracy"] = 30;
|
||||
d["latitude"] = QString::number(m_gpsdata->fix.latitude);
|
||||
d["longitude"] = QString::number(m_gpsdata->fix.longitude);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit dataReady(d);
|
||||
|
||||
m_condition.wait(&m_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
Gps::Gps(QObject* parent, const QVariantList& args)
|
||||
: GeolocationProvider(parent, args),
|
||||
m_gpsd(0)
|
||||
#if GPSD_API_MAJOR_VERSION >= 5
|
||||
, m_gpsdata(0)
|
||||
#endif
|
||||
{
|
||||
#if GPSD_API_MAJOR_VERSION >= 5
|
||||
m_gpsdata = new gps_data_t;
|
||||
if (gps_open("localhost", DEFAULT_GPSD_PORT, m_gpsdata) != -1) {
|
||||
#else
|
||||
gps_data_t* m_gpsdata = gps_open("localhost", DEFAULT_GPSD_PORT);
|
||||
if (m_gpsdata) {
|
||||
#endif
|
||||
kDebug() << "gpsd found.";
|
||||
m_gpsd = new Gpsd(m_gpsdata);
|
||||
connect(m_gpsd, SIGNAL(dataReady(Plasma::DataEngine::Data)),
|
||||
this, SLOT(setData(Plasma::DataEngine::Data)));
|
||||
} else {
|
||||
kDebug() << "gpsd not found";
|
||||
}
|
||||
|
||||
setIsAvailable(m_gpsd);
|
||||
}
|
||||
|
||||
Gps::~Gps()
|
||||
{
|
||||
delete m_gpsd;
|
||||
#if GPSD_API_MAJOR_VERSION >= 5
|
||||
delete m_gpsdata;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Gps::update()
|
||||
{
|
||||
if (m_gpsd) {
|
||||
m_gpsd->update();
|
||||
}
|
||||
}
|
||||
|
||||
K_EXPORT_PLASMA_GEOLOCATIONPROVIDER(gps, Gps)
|
||||
|
||||
#include "moc_location_gps.cpp"
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Petri Damstén <damu@iki.fi>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GPS_H
|
||||
#define GPS_H
|
||||
|
||||
#include <gps.h>
|
||||
#include <QThread>
|
||||
#include <QMutex>
|
||||
#include <QWaitCondition>
|
||||
|
||||
#include "geolocationprovider.h"
|
||||
|
||||
class Gpsd : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Gpsd(gps_data_t* gpsdata);
|
||||
virtual ~Gpsd();
|
||||
|
||||
void update();
|
||||
|
||||
signals:
|
||||
void dataReady(const Plasma::DataEngine::Data& data);
|
||||
|
||||
protected:
|
||||
virtual void run();
|
||||
|
||||
private:
|
||||
gps_data_t* m_gpsdata;
|
||||
QMutex m_mutex;
|
||||
QWaitCondition m_condition;
|
||||
bool m_abort;
|
||||
};
|
||||
|
||||
class Gps : public GeolocationProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Gps(QObject *parent = 0, const QVariantList &args = QVariantList());
|
||||
~Gps();
|
||||
|
||||
void update();
|
||||
|
||||
private:
|
||||
Gpsd* m_gpsd;
|
||||
#if GPSD_API_MAJOR_VERSION >= 5
|
||||
gps_data_t* m_gpsdata;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,143 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Name=Geolocation GPS
|
||||
Name[ar]=الموقع الجغرافي جي بي اس
|
||||
Name[ast]=Xeollocalización per aciu de GPS
|
||||
Name[bg]=Геолокация (GPS)
|
||||
Name[bs]=geolokacija GPS
|
||||
Name[ca]=Geolocalització GPS
|
||||
Name[ca@valencia]=Geolocalització GPS
|
||||
Name[cs]=Geolokace GPS
|
||||
Name[csb]=Geògrafnô lokalizacëjô GPS
|
||||
Name[da]=GPS til geo-lokalisering
|
||||
Name[de]=Geolokalisierung GPS
|
||||
Name[el]=GPS Γεωτοποθέτηση
|
||||
Name[en_GB]=Geolocation GPS
|
||||
Name[eo]=GPS loktrovado
|
||||
Name[es]=Geolocalización mediante GPS
|
||||
Name[et]=Geolokatsioon GPS-ist
|
||||
Name[eu]=GPS geokokapena
|
||||
Name[fi]=Paikkasijainti GPS
|
||||
Name[fr]=Géo-localisation par GPS
|
||||
Name[fy]=Geolokaasje GPS
|
||||
Name[ga]=Córas Suite Domhanda Geolocation
|
||||
Name[gl]=Xeolocalización con GPS
|
||||
Name[he]=מציאת מיקום גאוגרפי GPS
|
||||
Name[hr]=GPS geolociranje
|
||||
Name[hu]=GPS-alapú helyzetjelző
|
||||
Name[ia]=Geolocation GPS
|
||||
Name[id]=GPS Geolokasi
|
||||
Name[is]=GPS hnattstaðsetning
|
||||
Name[it]=Geolocalizzazione GPS
|
||||
Name[ja]=ジオロケーション GPS
|
||||
Name[kk]=GPS-тен орнын табу
|
||||
Name[km]=ទីតាំងភូមិសាស្ត្រ GPS
|
||||
Name[kn]=ಭೂಪ್ರದೇಶದ GPS
|
||||
Name[ko]=GPS 위치
|
||||
Name[lt]=Geolokacinis GPS
|
||||
Name[lv]=Ģeolokācija GPS
|
||||
Name[mai]=भूअवस्थिति जीपीएस
|
||||
Name[mk]=ГПС за геолоцирање
|
||||
Name[ml]=ജിപിഎസ് ഭൂസ്ഥാനങ്ങള്
|
||||
Name[mr]=GPS जिओलोकेशन
|
||||
Name[nb]=Geografisk plassering GPS
|
||||
Name[nds]=GPS-Eersteed
|
||||
Name[nl]=Geolocatie GPS
|
||||
Name[nn]=Geolocation GPS
|
||||
Name[pa]=ਭੂਗੋਲਿਕ-ਟਿਕਾਣਾ GPS
|
||||
Name[pl]=Geolokalizacja: GPS
|
||||
Name[pt]=Geo-Localização por GPS
|
||||
Name[pt_BR]=Localização geográfica GPS
|
||||
Name[ro]=GPS geolocație
|
||||
Name[ru]=Геолокация по GPS
|
||||
Name[si]=පිහිටුම් GPS
|
||||
Name[sk]=Geolokalizácia GPS
|
||||
Name[sl]=Geolokacija GPS
|
||||
Name[sr]=геолокација ГПС
|
||||
Name[sr@ijekavian]=геолокација ГПС
|
||||
Name[sr@ijekavianlatin]=geolokacija GPS
|
||||
Name[sr@latin]=geolokacija GPS
|
||||
Name[sv]=Lokalisera geografiskt med GPS
|
||||
Name[tg]=Ҷойгиршавии GPS
|
||||
Name[th]=การระบุพิกัดตำแหน่งด้วย GPS
|
||||
Name[tr]=Geolocation GPS
|
||||
Name[ug]=جۇغراپىيىلىك ئورۇن GPS
|
||||
Name[uk]=Геопозиціювання за GPS
|
||||
Name[vi]=Vị trí địa lý GPS
|
||||
Name[wa]=GPS di djeyoplaeçmint
|
||||
Name[x-test]=xxGeolocation GPSxx
|
||||
Name[zh_CN]=GPS 位置
|
||||
Name[zh_TW]=Geolocation GPS
|
||||
Comment=Geolocation from GPS address.
|
||||
Comment[ar]=الموقع الجغرافي من عنوان جي بي اس
|
||||
Comment[ast]=Xeollocalización dende una direición GPS.
|
||||
Comment[bg]=Геолокация от GPS адрес.
|
||||
Comment[bs]=Geolociranje kroz GPS adresu.
|
||||
Comment[ca]=Geolocalització des d'una adreça GPS.
|
||||
Comment[ca@valencia]=Geolocalització des d'una adreça GPS.
|
||||
Comment[cs]=Geolokace z GPS adresy.
|
||||
Comment[csb]=Geògrafnô lokalizacëjô z adresë GPS.
|
||||
Comment[da]=Geo-lokalisering ud fra GPS-adresse.
|
||||
Comment[de]=Geolokalisierung mittels GPS-Koordinate.
|
||||
Comment[el]=Γεωτοποθέτηση από GPS διεύθυνση.
|
||||
Comment[en_GB]=Geolocation from GPS address.
|
||||
Comment[eo]=Loktrovado el GPS adreso
|
||||
Comment[es]=Geolocalización desde una dirección GPS.
|
||||
Comment[et]=Geolokatsioon GPS-aadressi põhjal
|
||||
Comment[eu]=Geokokapena GPS helbidetik.
|
||||
Comment[fi]=Paikkasijainti GPS-osoitteesta.
|
||||
Comment[fr]=Géo-localisation depuis une adresse GPS.
|
||||
Comment[fy]=Geolokaasje fan GPS adres.
|
||||
Comment[ga]=Suíomh geografach ó sheoladh GPS.
|
||||
Comment[gl]=Xeolocaliza con datos de GPS.
|
||||
Comment[he]=מציאת מיקום גאוגרפי ממיקום GPS.
|
||||
Comment[hr]=Geolociranje s GPS adrese.
|
||||
Comment[hu]=A földrajzi helyzet meghatározása GPS segítségével.
|
||||
Comment[ia]=Geolocation ex adresse GPS.
|
||||
Comment[id]=Geolokasi dari alamat GPS.
|
||||
Comment[is]=Hnattstaðsetning eftir GPS vistfangi.
|
||||
Comment[it]=Geolocalizzazione dalla posizione GPS.
|
||||
Comment[ja]=GPS アドレスによるジオロケーション
|
||||
Comment[kk]=GPS адресінен орнын табу
|
||||
Comment[km]=ទីតាំងភូមិសាស្ត្រពីអាយដ្ឋាន GPS ។
|
||||
Comment[kn]=GPS ವಿಳಾಸದಿಂದ ಭೂಪ್ರದೇಶ.
|
||||
Comment[ko]=GPS 위치에 따른 주소입니다.
|
||||
Comment[lt]=Geolokacija pagal GPS adresą.
|
||||
Comment[lv]=Ģeolokācija no GPS adreses.
|
||||
Comment[mai]=GPS पता सँ भूअवस्थिति.
|
||||
Comment[mk]=Геолокација преку ГПС-адреса.
|
||||
Comment[ml]=ജിപിഎസ് വിലാസത്തില് നിന്നും ഭൂസ്ഥാനങ്ങള്
|
||||
Comment[mr]=GPS पत्त्यावरुन जिओलोकेशन.
|
||||
Comment[nb]=Geografisk plassering etter GPS-adresse.
|
||||
Comment[nds]=Eersteed ut GPS-Adress
|
||||
Comment[nl]=Geolocatie uit GPS-adres.
|
||||
Comment[nn]=Geolocation med GPS-adresse.
|
||||
Comment[pa]=GPS ਐਡਰੈੱਸ ਤੋਂ ਭੂਗੋਲਿਕ ਟਿਕਾਣਾ।
|
||||
Comment[pl]=Geolokalizacja z adresu GPS.
|
||||
Comment[pt]=Geo-localização a partir do endereço do GPS.
|
||||
Comment[pt_BR]=Localização geográfica de endereços de GPS.
|
||||
Comment[ro]=Geolocație din adresă GPS.
|
||||
Comment[ru]=Геолокация по адресу GPS.
|
||||
Comment[si]=GPS ලිපින මගින් පිහිටුම
|
||||
Comment[sk]=Geolokalizácia z GPS adresy.
|
||||
Comment[sl]=Geolokacija iz podatkov GPS.
|
||||
Comment[sr]=Геолоцирање кроз ГПС адресу.
|
||||
Comment[sr@ijekavian]=Геолоцирање кроз ГПС адресу.
|
||||
Comment[sr@ijekavianlatin]=Geolociranje kroz GPS adresu.
|
||||
Comment[sr@latin]=Geolociranje kroz GPS adresu.
|
||||
Comment[sv]=Geografisk lokalisering från GPS-adress.
|
||||
Comment[tg]=Ҷойгиршавии ҷуғрофӣ аз суроғаи GPS
|
||||
Comment[th]=การระบุพิกัดตำแหน่งจากพิกัด GPS
|
||||
Comment[tr]=GPS adresinden coğrafi konum.
|
||||
Comment[ug]=GPS ئادرېسنىڭ جۇغراپىيىلىك ئورنى
|
||||
Comment[uk]=Геопозиціювання за GPS-адресою
|
||||
Comment[vi]=Vị trí địa lý từ địa chỉ GPS.
|
||||
Comment[wa]=Djeyoplaeçmint a pårti d' ene adresse GPS.
|
||||
Comment[x-test]=xxGeolocation from GPS address.xx
|
||||
Comment[zh_CN]=GPS 地址产生的位置
|
||||
Comment[zh_TW]=從 GPS 位址取得 Geolocation。
|
||||
X-KDE-ServiceTypes=Plasma/GeolocationProvider
|
||||
X-KDE-ParentApp=geolocation
|
||||
Type=Service
|
||||
Icon=applications-internet
|
||||
X-KDE-Library=plasma-geolocation-gps
|
||||
X-KDE-PluginInfo-Name=gps
|
Loading…
Add table
Reference in a new issue