[Marble-commits] KDE/kdeedu/marble/src/plugins/positionprovider/gpsd
Dennis Nienhüser
earthwings at gentoo.org
Fri Jan 1 18:38:22 CET 2010
SVN commit 1068625 by nienhueser:
Do not set a guessed GPSD_API_MAJOR_VERSION value if it is not available. Initialize pointer. Fix call logic for 2.3x (also GPSD_API_MAJOR_VERSION==3)
M +4 -9 GpsdConnection.cpp
--- trunk/KDE/kdeedu/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp #1068624:1068625
@@ -12,11 +12,6 @@
#include "MarbleDebug.h"
-#ifndef GPSD_API_MAJOR_VERSION
- #define GPSD_API_MAJOR_VERSION 2
-#endif
-
-
using namespace Marble;
GpsdConnection::GpsdConnection( QObject* parent )
@@ -36,13 +31,13 @@
void GpsdConnection::update()
{
- gps_data_t* data;
-#if GPSD_API_MAJOR_VERSION == 2
- data = m_gpsd.query( "o" );
-#elif GPSD_API_MAJOR_VERSION == 3 && defined( POLICY_SET )
+ gps_data_t* data = 0;
+#if GPSD_API_MAJOR_VERSION == 3 && defined( POLICY_SET )
while ((data = m_gpsd.poll()) && !(data->set & POLICY_SET)) {
data = m_gpsd.poll();
}
+#else
+ data = m_gpsd.query( "o" );
#endif
if ( data )
emit gpsdInfo( *data );
More information about the Marble-commits
mailing list