|
|
@ -0,0 +1,59 @@ |
|
|
|
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
# |
|
|
|
# Filename: package/.../kdeedu/kdeedu-4.6.2-gpsd-api-v5.patch |
|
|
|
# Copyright (C) 2011 The OpenSDE Project |
|
|
|
# |
|
|
|
# More information can be found in the files COPYING and README. |
|
|
|
# |
|
|
|
# This patch file is dual-licensed. It is available under the license the |
|
|
|
# patched project is licensed under, as long as it is an OpenSource license |
|
|
|
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or 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. |
|
|
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
|
|
|
|
Description: Support the API v5 which is used by recent versions of gpsd |
|
|
|
|
|
|
|
--- kdeedu-4.6.2/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp.orig 2011-05-03 12:12:45.920001223 +0200
|
|
|
|
+++ kdeedu-4.6.2/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp 2011-05-03 12:17:24.236001222 +0200
|
|
|
|
@@ -20,6 +20,9 @@
|
|
|
|
|
|
|
|
GpsdConnection::GpsdConnection( QObject* parent ) |
|
|
|
: QObject( parent ), |
|
|
|
+#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
|
|
|
|
+ m_gpsd("localhost", DEFAULT_GPSD_PORT),
|
|
|
|
+#endif
|
|
|
|
m_timer( 0 ) |
|
|
|
{ |
|
|
|
m_oldLocale = setlocale( LC_NUMERIC, NULL ); |
|
|
|
@@ -35,7 +38,11 @@
|
|
|
|
void GpsdConnection::initialize() |
|
|
|
{ |
|
|
|
m_timer.stop(); |
|
|
|
+#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
|
|
|
|
+ gps_data_t* data;
|
|
|
|
+#else
|
|
|
|
gps_data_t* data = m_gpsd.open(); |
|
|
|
+#endif
|
|
|
|
if ( data ) { |
|
|
|
m_status = PositionProviderStatusAcquiring; |
|
|
|
emit statusChanged( m_status ); |
|
|
|
@@ -82,8 +89,16 @@
|
|
|
|
void GpsdConnection::update() |
|
|
|
{ |
|
|
|
#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 3 ) && defined( PACKET_SET ) |
|
|
|
+#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
|
|
|
|
+ if ( m_gpsd.waiting(0) ) {
|
|
|
|
+#else
|
|
|
|
if ( m_gpsd.waiting() ) { |
|
|
|
+#endif
|
|
|
|
+#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
|
|
|
|
+ gps_data_t* data = m_gpsd.read();
|
|
|
|
+#else
|
|
|
|
gps_data_t* data = m_gpsd.poll(); |
|
|
|
+#endif
|
|
|
|
if ( data && data->set & PACKET_SET ) { |
|
|
|
emit gpsdInfo( *data ); |
|
|
|
} |