summaryrefslogtreecommitdiffstats
path: root/process.cpp
diff options
context:
space:
mode:
authorRainer Keller <rainer.keller@theqtcompany.com>2015-06-09 12:34:12 +0200
committerRainer Keller <rainer.keller@theqtcompany.com>2015-06-09 13:50:01 +0300
commit3804f0dc00471a209bb5d85ba3816c09af877109 (patch)
tree3607ea2f64068dde5f04376120d1cb4d7b6a5eef /process.cpp
parent2631768b484176836694ec4afdb81ef31886c142 (diff)
Make appcontroller a temporary daemon
For a restart being successful the application has to be shut down with out terminating the appcontroller. Afterwards the appcontroller will be able to start the application again. Change-Id: I38fd0aded176a10dac40c419b6866ce70ec1fcef Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'process.cpp')
-rw-r--r--process.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/process.cpp b/process.cpp
index 64bbc13..d3d8fdb 100644
--- a/process.cpp
+++ b/process.cpp
@@ -259,7 +259,8 @@ void Process::stop()
{
if (mProcess->state() == QProcess::QProcess::NotRunning) {
printf("No process running\n");
- qApp->exit();
+ if (!mBeingRestarted)
+ qApp->exit();
return;
}
@@ -276,6 +277,13 @@ void Process::stop()
mProcess->kill();
}
+void Process::stopForRestart()
+{
+ printf("Stopping application for restart\n");
+ mBeingRestarted = true;
+ stop();
+}
+
void Process::restart()
{
printf("Restarting application\n");
@@ -313,6 +321,8 @@ void Process::incomingConnection(int i)
stop();
else if (command == "restart")
restart();
+ else if (command == "stopForRestart")
+ stopForRestart();
else
stop();
}