diff -ur kdeedu-4.6.5/marble/src/plugins/positionprovider/gpsd//GpsdConnection.cpp src/plugins/positionprovider/gpsd//GpsdConnection.cpp --- kdeedu-4.6.5/marble/src/plugins/positionprovider/gpsd//GpsdConnection.cpp 2011-06-03 17:41:57.000000000 -0400 +++ src/plugins/positionprovider/gpsd//GpsdConnection.cpp 2011-12-10 12:19:19.000000000 -0500 @@ -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,8 +38,14 @@ void GpsdConnection::initialize() { m_timer.stop(); + bool success = false; +#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 ) + success = true; +#else gps_data_t* data = m_gpsd.open(); - if ( data ) { + success = ( data != 0 ); +#endif + if ( success ) { m_status = PositionProviderStatusAcquiring; emit statusChanged( m_status ); @@ -81,7 +90,14 @@ 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 ) ) { + gps_data_t* data = m_gpsd.read(); + if ( data && data->set & PACKET_SET ) { + emit gpsdInfo( *data ); + } + } +#elif defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 3 ) && defined( PACKET_SET ) if ( m_gpsd.waiting() ) { gps_data_t* data = m_gpsd.poll(); if ( data && data->set & PACKET_SET ) {