Commit 51e0d912 authored by Antonio Rojas's avatar Antonio Rojas

Fix build with gpsd 3.20

gps_data_t.fix.time is a struct timespec in gpsd>=3.20

Differential Revision: https://phabricator.kde.org/D26486
parent ed30aee9
......@@ -113,9 +113,17 @@ void GpsdPositionProviderPlugin::update( gps_data_t data )
m_track = data.fix.track;
}
#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 9 )
if ( !std::isnan( data.fix.time.tv_sec ) )
#else
if ( !std::isnan( data.fix.time ) )
#endif
{
#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 9 )
m_timestamp = QDateTime::fromMSecsSinceEpoch( data.fix.time.tv_sec * 1000 + data.fix.time.tv_nsec / 1000000 );
#else
m_timestamp = QDateTime::fromMSecsSinceEpoch( data.fix.time * 1000 );
#endif
}
}
if (m_status != oldStatus)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment