DESTDIR = build
TEMPLATE = app
-QT += network webkit maemo5
-CONFIG += link_pkgconfig
-PKGCONFIG += glib-2.0 liblocation
+QT += network webkit
+
+contains(QT_CONFIG, maemo5) {
+ QT += maemo5
+ CONFIG += link_pkgconfig
+ PKGCONFIG += glib-2.0 liblocation
+}
#include <QObject>
+#ifdef Q_WS_MAEMO_5
+
extern "C" {
#include <location/location-gps-device.h>
#include <location/location-gpsd-control.h>
void GpsMaemo5_changed(LocationGPSDevice *device, GpsMaemo5 *gps);
+#else // Q_WS_MAEMO_5
+
+class GpsMaemo5 : public QObject {
+ Q_OBJECT
+
+signals:
+ void fix();
+
+public:
+ GpsMaemo5(QObject *parent = 0) { Q_UNUSED(parent); }
+ double get_lat() { return 0; }
+ double get_lon() { return 0; }
+ double get_acc() { return 0; }
+};
+
+#endif // Q_WS_MAEMO_5
+
#endif // GPS_H
#include "latitude.h"
LatitudeGUI::LatitudeGUI(QMainWindow *parent) : QMainWindow(parent) {
+#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5AutoOrientation, true);
- setWindowTitle(tr("Google Latitude Updater"));
+#endif
+ setWindowTitle(tr("Latitude & Buzz"));
setting = new QSettings();
}
void LatitudeGUI::set() {
- QMaemo5InformationBox::information(this, "New gps position", 1000);
+#ifdef Q_WS_MAEMO_5
+ QMaemo5InformationBox::information(this, "new position...", 1000);
+#else
+ qDebug() << "new position...";
+#endif
glatitude->login(setting->value("user","my_username").toString(),
setting->value("pass","my_password").toString());
glatitude->set(gps->get_lat(),
}
void LatitudeGUI::latitude_OK() {
- QMaemo5InformationBox::information(this, "Location Sent!", 1000);
+#ifdef Q_WS_MAEMO_5
+ QMaemo5InformationBox::information(this, "...location Sent!", 1000);
+#else
+ qDebug() << "...location Sent!";
+#endif
}
void LatitudeGUI::latitude_ERROR() {
+#ifdef Q_WS_MAEMO_5
QMaemo5InformationBox::information(this, "Error in Authentification !", 3000);
+#else
+ qDebug() << "Error in Authentification !";
+#endif
}
void LatitudeGUI::save_user(QString _user) {