daemon mode and bugs fixes
[googlelatitude] / src / gps.h
index ca5ea9d..9f1cac9 100644 (file)
--- a/src/gps.h
+++ b/src/gps.h
@@ -3,10 +3,14 @@
 
 #include <QObject>
 
+#ifdef Q_WS_MAEMO_5
 extern "C" {
 #include <location/location-gps-device.h>
 #include <location/location-gpsd-control.h>
 }
+#else
+#include <QtNetwork>
+#endif // Q_WS_MAEMO_5
 
 class GpsMaemo5 : public QObject {
     Q_OBJECT
@@ -19,18 +23,33 @@ public:
     double get_lat() { return latitude; }
     double get_lon() { return longitude; }
     double get_acc() { return accuracy; }
+#ifdef Q_WS_MAEMO_5
     friend void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
+#endif // Q_WS_MAEMO_5
+
+#ifdef Q_WS_MAEMO_5
+#else
+private slots:
+    void finishedreply(QNetworkReply *r);
+#endif // Q_WS_MAEMO_5
 
 private:
     double latitude;
     double longitude;
     double accuracy;
-
+#ifdef Q_WS_MAEMO_5
     GMainLoop *loop;
     LocationGPSDControl *control;
     LocationGPSDevice *device;
+#else
+    QUrl urlloc;
+    QNetworkAccessManager *worker;
+#endif // Q_WS_MAEMO_5
+
 };
 
+#ifdef Q_WS_MAEMO_5
 void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
+#endif // Q_WS_MAEMO_5
 
 #endif // GPS_H