X-Git-Url: http://git.maemo.org/git/?p=googlelatitude;a=blobdiff_plain;f=latitudeqml.h;h=c8685515e0ea7439aecc906e32df80604efd7ffe;hp=13c8b272d666c2dc61dc159ea1748f3854b554f9;hb=d61a299b8bfaa74e8c2680923a3efbbcf2ab8347;hpb=05be3d4e9145560968c3afc78c1fcca644cc7a9e;ds=sidebyside diff --git a/latitudeqml.h b/latitudeqml.h index 13c8b27..c868551 100644 --- a/latitudeqml.h +++ b/latitudeqml.h @@ -3,6 +3,10 @@ #include #include +#include +#include +#include +#include #include "googlelatitude.h" #include "gpscontrol.h" @@ -14,12 +18,45 @@ public: signals: public slots: + bool demonio_status() { + qDebug() << "LatitudeQML::demonio_status"; + if (system("killall -0 LatitudeUpdaterDaemon 2> /dev/null" )) { + return false; + } + return true; + } + bool demonio_start() { + qDebug() << "LatitudeQML::demonio_start"; + if (demonioOpt.exists()) { + qDebug() << "LatitudeQML:: demonio opt"; + cli.startDetached(demonioOpt.fileName()); + return true; + } + if (demonioSdk.exists()) { + qDebug() << "LatitudeQML:: demonio sdk"; + cli.startDetached(demonioSdk.fileName()); + return true; + } + qDebug() << "LatitudeQML:: demonio none"; + return false; + } + bool demonio_stop() { + qDebug() << "LatitudeQML::demonio_stop"; + if (demonioOpt.exists() || demonioSdk.exists() ) { + qDebug() << "LatitudeQML:: demonio kill" << system("killall LatitudeUpdaterDaemon 2> /dev/null"); + return true; + } + return false; + } private slots: private: GoogleLatitude latitude; GpsControl gps; + QFile demonioOpt; + QFile demonioSdk; + QProcess cli; }; #endif // LatitudeQML_H