[Marble-commits] KDE/kdeedu/marble/src/plugins/positionprovider/gpsd
Thibaut Gridel
tgridel at free.fr
Tue Jun 1 23:11:17 CEST 2010
SVN commit 1133510 by tgridel:
fix gpsd provider for MODE_2D and emit positionChanged when position really changed
M +5 -2 GpsdPositionProviderPlugin.cpp
--- trunk/KDE/kdeedu/marble/src/plugins/positionprovider/gpsd/GpsdPositionProviderPlugin.cpp #1133509:1133510
@@ -63,6 +63,9 @@
m_status = PositionProviderStatusAvailable;
m_position.set( data.fix.longitude, data.fix.latitude,
data.fix.altitude, GeoDataCoordinates::Degree );
+ if (data.fix.mode == MODE_2D) {
+ m_position.setAltitude(0);
+ }
m_accuracy.level = GeoDataAccuracy::Detailed;
// FIXME: Add real values here
m_accuracy.horizontal = 5;
@@ -70,10 +73,10 @@
}
if (m_status != oldStatus)
emit statusChanged( m_status );
- // FIXME: Check whether position has changed first
- if ( m_status == PositionProviderStatusAvailable )
+ if (!(oldPosition == m_position)) {
emit positionChanged( m_position, m_accuracy );
}
+}
bool GpsdPositionProviderPlugin::isInitialized() const
{
More information about the Marble-commits
mailing list