Fix double toolbar
[googlelatitude] / latitudeqml.h
1 #ifndef LatitudeQML_H
2 #define LatitudeQML_H
3
4 #include <QObject>
5 #include <QtDeclarative/QDeclarativeView>
6 #include <QtCore/QProcess>
7 #include <QtCore/QCoreApplication>
8 #include <QtCore/QDir>
9 #include <QtCore/QFile>
10 #include "googlelatitude.h"
11 #include "gpscontrol.h"
12
13 class LatitudeQML : public QDeclarativeView {
14     Q_OBJECT
15 public:
16     LatitudeQML(QDeclarativeView *parent = 0);
17
18 signals:
19
20 public slots:
21     bool demonio_status() {
22         qDebug() << "LatitudeQML::demonio_status";
23         if (system("killall -0 LatitudeUpdaterDaemon 2> /dev/null" )) {
24             return false;
25         }
26         return true;
27     }
28     bool demonio_start() {
29         qDebug() << "LatitudeQML::demonio_start";
30         if (demonio.exists()) {
31             cli.startDetached(demonio.fileName());
32             return true;
33         }
34         qDebug() << "LatitudeQML:: demonio none";
35         return false;
36     }
37     bool demonio_stop() {
38         qDebug() << "LatitudeQML::demonio_stop";
39         if (demonio.exists()) {
40             qDebug() << "LatitudeQML:: demonio kill" << system("killall LatitudeUpdaterDaemon 2> /dev/null");
41             return true;
42         }
43         return false;
44     }
45
46 private slots:
47
48 private:
49     GoogleLatitude latitude;
50     GpsControl gps;
51     QFile demonio;
52     QProcess cli;
53 };
54
55 #endif // LatitudeQML_H