Fixed an error in settings dialog that caused app to segfault on arm. Changed init...
[jenirok] / src / gui / daemon.cpp
index 6a5a4e8..c5bc0d4 100644 (file)
@@ -24,14 +24,12 @@ namespace
 {
     const QString DAEMON_NAME = "jenirokd";
     const QString INIT_DIR = "/etc/init.d";
-    const QString AUTOSTART_ENABLE = "update-rc.d jenirokd defaults 99";
-    const QString AUTOSTART_DISABLE = "update-rc.d -f jenirokd remove";
 }
 
 bool Daemon::start()
 {
     QProcess proc;
-    proc.start(INIT_DIR + "/" + DAEMON_NAME, QStringList() << "start");
+    proc.start(INIT_DIR + "/" + DAEMON_NAME, QStringList() << "start" << "manual");
 
     proc.waitForStarted();
     proc.waitForFinished();
@@ -87,31 +85,6 @@ bool Daemon::isRunning()
     return !result.isEmpty();
 }
 
-bool Daemon::setAutostart(bool enabled)
-{
-    QProcess proc;
-
-    if(enabled)
-    {
-        proc.start(AUTOSTART_ENABLE);
-    }
-    else
-    {
-        proc.start(AUTOSTART_DISABLE);
-    }
-
-    proc.waitForStarted();
-    proc.waitForFinished();
-
-    if(proc.exitCode() != 0)
-    {
-        return false;
-    }
-
-    return true;
-
-}
-
 Daemon::Daemon()
 {
 }