[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeedu/marble/src/plugins/positionprovider/gpsd
From: Jens-Michael Hoffmann <jensmh () gmx ! de>
Date: 2009-12-18 21:03:42
Message-ID: 1261170222.171719.29757.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1063585 by jmhoffmann:
Make gpsd positionprovider plugin compile with gpsd API 3, as of gpsd 2.90+.
M +11 -1 GpsdConnection.cpp
--- trunk/KDE/kdeedu/marble/src/plugins/positionprovider/gpsd/GpsdConnection.cpp #1063584:1063585
@@ -22,6 +22,9 @@
{
gps_data_t* data = m_gpsd.open();
if ( data ) {
+#if GPSD_API_MAJOR_VERSION == 3
+ m_gpsd.stream( WATCH_ENABLE );
+#endif
connect( &m_timer, SIGNAL( timeout() ), this, SLOT( update() ) );
m_timer.start( 1000 );
} else
@@ -30,7 +33,14 @@
void GpsdConnection::update()
{
- gps_data_t* data = m_gpsd.query( "o" );
+ gps_data_t* data;
+#if GPSD_API_MAJOR_VERSION == 2
+ data = m_gpsd.query( "o" );
+#elif GPSD_API_MAJOR_VERSION == 3
+ while ((data = m_gpsd.poll()) && !(data->set & POLICY_SET)) {
+ data = m_gpsd.poll();
+ }
+#endif
if ( data )
emit gpsdInfo( *data );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic