5 GpsMaemo5::GpsMaemo5(QObject *parent) : QObject(parent) {
10 control = location_gpsd_control_get_default();
11 device = (LocationGPSDevice*) g_object_new(LOCATION_TYPE_GPS_DEVICE, NULL);
13 g_signal_connect(device, "changed", G_CALLBACK(GpsMaemo5_changed), this);
14 g_object_set(G_OBJECT(control), "preferred-method", LOCATION_METHOD_ACWP, NULL);
15 g_object_set(G_OBJECT(control), "preferred-interval", LOCATION_INTERVAL_120S, NULL);
17 location_gpsd_control_start(control);
20 void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps) {
22 if (device->fix->fields) {
23 g_print("lat = %f, long = %f, eph = %f\n", gps->device->fix->latitude, gps->device->fix->longitude, gps->device->fix->eph/100.);
24 gps->latitude = gps->device->fix->latitude;
25 gps->longitude = gps->device->fix->longitude;
26 gps->accuracy = gps->device->fix->eph/100.;
32 #endif // Q_WS_MAEMO_5