Connection handling improved again. Added ability to bybass general Maemo connectivit...
[jenirok] / src / daemon / main.cpp
index 7dc2b01..307bb4d 100644 (file)
 #include <QtCore/QCoreApplication>
 #include <QtCore/QTranslator>
 #include <QtCore/QLocale>
+#include <QtCore/QString>
 #include <QtGui/QApplication>
+#include <QDebug>
 #include "calllistener.h"
 #include "settings.h"
 
 int main(int argc, char *argv[])
 {
-    // If daemon was started on boot, the first parameter is not set
-    if(!(argc >= 2 && argv[1] == "manual"))
+    // If daemon was started on boot, the first parameter is set to "-boot"
+    if(argc >= 2 && QString(argv[1]) == "-boot")
     {
         if(Settings::instance()->get("autostart") == "0")
         {
@@ -43,7 +45,10 @@ int main(int argc, char *argv[])
 
     CallListener listener;
 
-    listener.begin();
+    if(!listener.begin())
+    {
+        return 1;
+    }
 
     return app.exec();