X-Git-Url: http://git.maemo.org/git/?p=googlelatitude;a=blobdiff_plain;f=src%2Fmain.cpp;fp=src%2Fmain.cpp;h=42eebdd75800d95de3eb88c521b661fc887cc994;hp=fd38f35d215ca89ab7b983135dacbcc23e174991;hb=e98468d19d7c7f3b2e068e3bebcc5ff47dd61d9b;hpb=26b02985c72432ad0927b4f69656106423d1ab58 diff --git a/src/main.cpp b/src/main.cpp index fd38f35..42eebdd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,21 +1,31 @@ #include "latitude.h" +#include "daemon.h" int main(int argc, char *argv[]) { - QApplication app(argc, argv); QCoreApplication::setOrganizationName("linfati"); QCoreApplication::setOrganizationDomain("linfati.com"); QCoreApplication::setApplicationName("GoogleLatitude"); + QCoreApplication::setApplicationVersion("0.4.5"); - LatitudeGUI *gui = new LatitudeGUI(); - gui->show(); + if ( QString(argv[0]).contains("GoogleLatitudeDaemon") ) { + QCoreApplication app(argc, argv); + qDebug() << "main: Daemon"; + Daemon *demonio; + demonio = new Daemon(); + app.exec(); + } else if ( QString(argv[0]).contains("GoogleLatitudeGUI") ) { + QApplication app(argc, argv); + qDebug() << "main: GUI"; + LatitudeGUI *gui = new LatitudeGUI(); + gui->show(); + app.exec(); + } else { + QApplication app(argc, argv); + qDebug() << "main: default"; + LatitudeGUI *gui = new LatitudeGUI(); + gui->show(); + app.exec(); + } - return app.exec(); + return 0; } - -/* - TODO: - on auth error -> stop gps - on new pos, only set it - send new pos every 120s, only if is diferent - no n900 -> por ip - */