From: Rodrigo Linfati Date: Wed, 26 Jan 2011 16:23:14 +0000 (+0100) Subject: fix the NaN in gps X-Git-Url: http://git.maemo.org/git/?p=googlelatitude;a=commitdiff_plain;h=19db5401a07f28351c75ebfe3f478f1285d841fa;ds=sidebyside fix the NaN in gps --- diff --git a/src/gps.cpp b/src/gps.cpp index cd87f24..05fd97d 100644 --- a/src/gps.cpp +++ b/src/gps.cpp @@ -49,6 +49,8 @@ void GpsMaemo5::stop() { void GpsMaemo5::forcestop() { qDebug() << "GpsMaemo5: forcestop"; stopgps = true; + emitfix = false; + stop(); } int GpsMaemo5::config(int i, int w, bool g) { @@ -64,6 +66,7 @@ int GpsMaemo5::config(int i, int w, bool g) { void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps) { if (device->fix) { if (device->fix->fields) { + if ( isnan(gps->device->fix->eph) ) return; g_print("GpsMaemo5 lat %f lon %f eph %f\n", gps->device->fix->latitude, gps->device->fix->longitude, gps->device->fix->eph/100.); gps->latitude = gps->device->fix->latitude; gps->longitude = gps->device->fix->longitude;