From 4d3b808ff8806de1e859b5b05836cde40a10a241 Mon Sep 17 00:00:00 2001 From: Tilman Keskinoz Date: Sat, 14 May 2011 15:09:40 +0000 Subject: Fix build after libgps API change PR: 156489 Submitted by: Christoph Moench-Tegeder Approved by: maintainer timeout --- astro/qlandkartegt/files/patch-src-CDeviceGPSD.cpp | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 astro/qlandkartegt/files/patch-src-CDeviceGPSD.cpp (limited to 'astro') diff --git a/astro/qlandkartegt/files/patch-src-CDeviceGPSD.cpp b/astro/qlandkartegt/files/patch-src-CDeviceGPSD.cpp new file mode 100644 index 000000000000..94fa67203790 --- /dev/null +++ b/astro/qlandkartegt/files/patch-src-CDeviceGPSD.cpp @@ -0,0 +1,47 @@ +Index: src/CDeviceGPSD.cpp +=================================================================== +--- src/CDeviceGPSD.cpp (revision 2719) ++++ src/CDeviceGPSD.cpp (working copy) +@@ -138,6 +138,7 @@ + log_mutex( new QMutex() ), + pipe_fd( _pipe_fd ) + { ++ gpsdata = NULL; + } + + +@@ -149,7 +150,14 @@ + + void CGPSDThread::run() + { ++#if GPSD_API_MAJOR_VERSION >= 5 ++ int socket; ++ ++ if( gpsdata = new gps_data_t ) ++ socket = gps_open( "localhost", DEFAULT_GPSD_PORT, gpsdata ); ++#else + gpsdata = gps_open( "localhost", DEFAULT_GPSD_PORT ); ++#endif + if( !gpsdata ) + { + // TODO: message box (from other thread) +@@ -187,13 +195,20 @@ + } // if + else if( FD_ISSET( gpsdata->gps_fd, &fds ) ) + { ++#if GPSD_API_MAJOR_VERSION >= 5 ++ gps_read( gpsdata ); ++#else + gps_poll( gpsdata ); ++#endif + if( !decodeData() ) break; + } // else if + } // else if + } // while + + gps_close( gpsdata ); ++#if GPSD_API_MAJOR_VERSION >= 5 ++ delete gpsdata; ++#endif + qDebug() << "thread done"; + } -- cgit v1.2.3