X-Git-Url: http://git.maemo.org/git/?p=googlelatitude;a=blobdiff_plain;f=src%2Fgps.cpp;h=99080f992ceeae2e88b893027bdff6a9033fe1a6;hp=39c0627d7147ea5cea3ac09219a830e9eb367dcd;hb=7ee5f4d99ce070730090ad079c59ec2d5ab00906;hpb=189b6505f9453649b3c12a61928aa344d9a9bc5b diff --git a/src/gps.cpp b/src/gps.cpp index 39c0627..99080f9 100644 --- a/src/gps.cpp +++ b/src/gps.cpp @@ -1,6 +1,6 @@ #include "gps.h" -#ifdef Q_WS_MAEMO_5 +#ifdef LIBLOCATION GpsMaemo5::GpsMaemo5(QObject *parent) : QObject(parent) { latitude = 0; @@ -35,19 +35,20 @@ void GpsMaemo5::restart() { } void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps) { - if (device->fix) { - if (device->fix->fields & LOCATION_GPS_DEVICE_LATLONG_SET) { - g_print("lat = %f, long = %f, eph = %f\n", device->fix->latitude, device->fix->longitude, device->fix->eph/100.); - gps->latitude = device->fix->latitude; - gps->longitude = device->fix->longitude; - gps->accuracy = device->fix->eph/100.; + if (gps->device->fix) { + if (gps->device->fix->fields) { + g_print("lat = %f, long = %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; + gps->accuracy = gps->device->fix->eph/100.; if ( gps->usegps == 0) { emit gps->getOK_acwp(); + if ( gps->accuracy < 10*1000 ) gps->stop(); } else if ( gps->usegps == 1 ) { - if ( gps->device->satellites_in_use > 0 ) { - emit gps->getOK_agnss(); - } + emit gps->getOK_agnss(); + // if ( device->satellites_in_use > 0 ) gps->stop(); + if ( gps->device->fix->mode == LOCATION_GPS_DEVICE_MODE_3D ) gps->stop(); } else { emit gps->getOK(); }