Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Remove dependency on libgeoclue.
Re-implement Geoclue plugin using only Qt DBus dropping both the build-time and run-time dependency on libgeoclue. Allowing the Geoclue plugin to be build on all platforms that support Qt DBus. The priority of the Geoclue plugin has been lowered slightly so that the native position plugin, if available, has precedence. [ChangeLog][QtPositioning][Position] The Geoclue plugin has been re-implemented using Qt DBus. Task-number: QTBUG-40702 Change-Id: Ia06d089bfb46c10769ccffd765c044c361a9b484 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Upstream commit SHA1: a3cb74a
- Loading branch information
Showing
28 changed files
with
872 additions
and
641 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
load(configure) | ||
qtCompileTest(geoclue) | ||
qtCompileTest(geoclue-satellite) | ||
qtCompileTest(gypsy) | ||
|
||
load(qt_parts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
TARGET = qtposition_geoclue | ||
QT = core positioning | ||
QT = core positioning dbus | ||
|
||
PLUGIN_TYPE = position | ||
load(qt_plugin) | ||
|
||
HEADERS += \ | ||
qgeopositioninfosource_geocluemaster_p.h \ | ||
qgeopositioninfosource_geocluemaster.h \ | ||
qgeosatelliteinfosource_geocluemaster.h \ | ||
qgeopositioninfosourcefactory_geoclue.h \ | ||
qgeocluemaster.h | ||
qgeocluemaster.h \ | ||
geocluetypes.h | ||
|
||
SOURCES += \ | ||
qgeopositioninfosource_geocluemaster.cpp \ | ||
qgeosatelliteinfosource_geocluemaster.cpp \ | ||
qgeopositioninfosourcefactory_geoclue.cpp \ | ||
qgeocluemaster.cpp | ||
qgeocluemaster.cpp \ | ||
geocluetypes.cpp | ||
|
||
QDBUSXML2CPP_INTERFACE_HEADER_FLAGS += "-N -i geocluetypes.h" | ||
DBUS_INTERFACES += \ | ||
org.freedesktop.Geoclue.MasterClient.xml \ | ||
org.freedesktop.Geoclue.Master.xml \ | ||
org.freedesktop.Geoclue.Position.xml \ | ||
org.freedesktop.Geoclue.Velocity.xml \ | ||
org.freedesktop.Geoclue.Satellite.xml \ | ||
org.freedesktop.Geoclue.xml | ||
|
||
qtHaveModule(dbus):config_geoclue-satellite { | ||
DEFINES += HAS_SATELLITE | ||
|
||
QT *= dbus | ||
|
||
HEADERS += qgeosatelliteinfosource_geocluemaster.h | ||
SOURCES += qgeosatelliteinfosource_geocluemaster.cpp | ||
} | ||
|
||
INCLUDEPATH += $$QT.location.includes | ||
OTHER_FILES += \ | ||
$$DBUS_INTERFACES | ||
|
||
CONFIG += link_pkgconfig | ||
PKGCONFIG += geoclue | ||
INCLUDEPATH += $$QT.location.includes $$OUT_PWD | ||
|
||
OTHER_FILES += \ | ||
plugin.json \ | ||
plugin-satellite.json | ||
plugin.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2015 Aaron McCarthy <mccarthy.aaron@gmail.com> | ||
** Contact: http://www.qt-project.org/legal | ||
** | ||
** This file is part of the QtPositioning module of the Qt Toolkit. | ||
** | ||
** $QT_BEGIN_LICENSE:LGPL21$ | ||
** Commercial License Usage | ||
** Licensees holding valid commercial Qt licenses may use this file in | ||
** accordance with the commercial license agreement provided with the | ||
** Software or, alternatively, in accordance with the terms contained in | ||
** a written agreement between you and The Qt Company. For licensing terms | ||
** and conditions see http://www.qt.io/terms-conditions. For further | ||
** information use the contact form at http://www.qt.io/contact-us. | ||
** | ||
** GNU Lesser General Public License Usage | ||
** Alternatively, this file may be used under the terms of the GNU Lesser | ||
** General Public License version 2.1 or version 3 as published by the Free | ||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and | ||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the | ||
** following information to ensure the GNU Lesser General Public License | ||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | ||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | ||
** | ||
** As a special exception, The Qt Company gives you certain additional | ||
** rights. These rights are described in The Qt Company LGPL Exception | ||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | ||
** | ||
** $QT_END_LICENSE$ | ||
** | ||
****************************************************************************/ | ||
|
||
#include "geocluetypes.h" | ||
|
||
const QDBusArgument &dbus_argument_helper(const QDBusArgument &arg, Accuracy &accuracy) | ||
{ | ||
arg.beginStructure(); | ||
qint32 level; | ||
arg >> level; | ||
accuracy.m_level = static_cast<Accuracy::Level>(level); | ||
arg >> accuracy.m_horizontal; | ||
arg >> accuracy.m_vertical; | ||
arg.endStructure(); | ||
|
||
return arg; | ||
} | ||
|
||
QT_BEGIN_NAMESPACE | ||
|
||
QDBusArgument &operator<<(QDBusArgument &arg, const Accuracy &accuracy) | ||
{ | ||
arg.beginStructure(); | ||
arg << qint32(accuracy.level()); | ||
arg << accuracy.horizontal(); | ||
arg << accuracy.vertical(); | ||
arg.endStructure(); | ||
|
||
return arg; | ||
} | ||
|
||
const QDBusArgument &operator>>(const QDBusArgument &arg, Accuracy &accuracy) | ||
{ | ||
return dbus_argument_helper(arg, accuracy); | ||
} | ||
|
||
const QDBusArgument &operator>>(const QDBusArgument &argument, QGeoSatelliteInfo &si) | ||
{ | ||
qint32 a; | ||
|
||
argument.beginStructure(); | ||
argument >> a; | ||
si.setSatelliteIdentifier(a); | ||
argument >> a; | ||
si.setAttribute(QGeoSatelliteInfo::Elevation, a); | ||
argument >> a; | ||
si.setAttribute(QGeoSatelliteInfo::Azimuth, a); | ||
argument >> a; | ||
si.setSignalStrength(a); | ||
argument.endStructure(); | ||
return argument; | ||
} | ||
|
||
const QDBusArgument &operator>>(const QDBusArgument &argument, QList<QGeoSatelliteInfo> &sis) | ||
{ | ||
sis.clear(); | ||
|
||
argument.beginArray(); | ||
while (!argument.atEnd()) { | ||
QGeoSatelliteInfo si; | ||
argument >> si; | ||
sis.append(si); | ||
} | ||
argument.endArray(); | ||
|
||
return argument; | ||
} | ||
|
||
QT_END_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/plugins/position/geoclue/org.freedesktop.Geoclue.Master.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
<node> | ||
<interface name="org.freedesktop.Geoclue.Master"> | ||
<method name="Create"> | ||
<arg name="path" type="o" direction="out"/> | ||
</method> | ||
</interface> | ||
</node> | ||
|
41 changes: 41 additions & 0 deletions
41
src/plugins/position/geoclue/org.freedesktop.Geoclue.MasterClient.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
<node> | ||
<interface name="org.freedesktop.Geoclue.MasterClient"> | ||
<method name="GetPositionProvider"> | ||
<arg name="name" type="s" direction="out"/> | ||
<arg name="description" type="s" direction="out"/> | ||
<arg name="service" type="s" direction="out"/> | ||
<arg name="path" type="s" direction="out"/> | ||
</method> | ||
<method name="GetAddressProvider"> | ||
<arg name="name" type="s" direction="out"/> | ||
<arg name="description" type="s" direction="out"/> | ||
<arg name="service" type="s" direction="out"/> | ||
<arg name="path" type="s" direction="out"/> | ||
</method> | ||
<method name="PositionStart"> | ||
</method> | ||
<method name="AddressStart"> | ||
</method> | ||
<method name="SetRequirements"> | ||
<arg name="accuracyLevel" type="i" direction="in"/> | ||
<arg name="time" type="i" direction="in"/> | ||
<arg name="requireUpdates" type="b" direction="in"/> | ||
<arg name="allowedResources" type="i" direction="in"/> | ||
</method> | ||
<signal name="PositionProviderChanged"> | ||
<arg name="name" type="s"/> | ||
<arg name="description" type="s"/> | ||
<arg name="service" type="s"/> | ||
<arg name="path" type="s"/> | ||
</signal> | ||
<signal name="AddressProviderChanged"> | ||
<arg name="name" type="s"/> | ||
<arg name="description" type="s"/> | ||
<arg name="service" type="s"/> | ||
<arg name="path" type="s"/> | ||
</signal> | ||
</interface> | ||
</node> | ||
|
25 changes: 25 additions & 0 deletions
25
src/plugins/position/geoclue/org.freedesktop.Geoclue.Position.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
<node> | ||
<interface name="org.freedesktop.Geoclue.Position"> | ||
<method name="GetPosition"> | ||
<arg name="fields" type="i" direction="out"/> | ||
<arg name="timestamp" type="i" direction="out"/> | ||
<arg name="latitude" type="d" direction="out"/> | ||
<arg name="longitude" type="d" direction="out"/> | ||
<arg name="altitude" type="d" direction="out"/> | ||
<arg name="accuracy" type="(idd)" direction="out"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.Out5" value="Accuracy"/> | ||
</method> | ||
<signal name="PositionChanged"> | ||
<arg name="fields" type="i"/> | ||
<arg name="timestamp" type="i"/> | ||
<arg name="latitude" type="d"/> | ||
<arg name="longitude" type="d"/> | ||
<arg name="altitude" type="d"/> | ||
<arg name="accuracy" type="(idd)"/> | ||
<annotation name="org.qtproject.QtDBus.QtTypeName.In5" value="Accuracy"/> | ||
</signal> | ||
</interface> | ||
</node> | ||
|
Oops, something went wrong.