+#ifdef Q_WS_MAEMO_5
+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;
+ gps->accuracy = gps->device->fix->eph/100.;
+ gps->emitfix = true;
+ }
+ }
+}
+#else
+void GpsMaemo5::gloc_reply(QNetworkReply *r) {
+ if ( r->url() == urlloc ) {
+ QString loc = r->readAll();
+ QRegExp regexp ("\\{\"latitude\":(.*),\"longitude\":(.*),\"accuracy\":(.*)\\}");
+ regexp.setMinimal(1);
+ regexp.indexIn(loc, 1);
+ latitude = regexp.capturedTexts().at(1).toDouble();
+ longitude = regexp.capturedTexts().at(2).toDouble();
+ accuracy = regexp.capturedTexts().at(3).toDouble();
+ if ( accuracy > 100000 ) accuracy = 100000;
+ qDebug() << "GpsIP lat" << latitude << "lon" << longitude << "acc" << accuracy;
+ emitfix = true;
+ } else {
+ qDebug() << "GpsIP Error url" << r->url();
+ qDebug() << r->rawHeaderList();
+ qDebug() << r->readAll();
+ }