summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2014-11-25 14:05:57 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2014-11-25 15:32:15 +0200
commite26ef5e48cba706b34376d1122313efad12c2528 (patch)
tree7d0627a115121dc74f65d5dd8d2ac17b0c9085ce
parentfe76b7a6b182eb42a405f4b76bbabc6101f13f9a (diff)
Add a --launch option to appcontrollerv4.0.0
This will trigger a "fire and forget" mode where we won't bother with the server sockets. This allows launching multiple apps with appcontroller without killing the previous one. This is the preferred approach to launch Wayland applications. We still would like to use appcontroller (to set up the environment) but killing the previous app is not desirable. Tooling does not need to be considered now. Change-Id: I9119d622b12aaf79cfb2e68c95bacd079dffeb52 Reviewed-by: Rainer Keller <rainer.keller@theqtcompany.com>
-rw-r--r--main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 3fa2a14..e00fced 100644
--- a/main.cpp
+++ b/main.cpp
@@ -223,6 +223,7 @@ int main(int argc, char **argv)
quint16 gdbDebugPort = 0;
bool useGDB = false;
bool useQML = false;
+ bool fireAndForget = false;
Utils::PortList range;
if (args.isEmpty()) {
@@ -254,6 +255,8 @@ int main(int argc, char **argv)
} else if (arg == "--stop") {
stop();
return 0;
+ } else if (arg == "--launch") {
+ fireAndForget = true;
} else if (arg == "--show-platform") {
printf("base:%s\nplatform:%s\n",
config.base.toLocal8Bit().constData(),
@@ -323,7 +326,7 @@ int main(int argc, char **argv)
defaultArgs.push_front("gdbserver");
}
- if (createServerSocket() != 0) {
+ if (!fireAndForget && createServerSocket() != 0) {
fprintf(stderr, "Could not create serversocket\n");
return 1;
}
@@ -338,7 +341,8 @@ int main(int argc, char **argv)
process.setSocketNotifier(new QSocketNotifier(serverSocket, QSocketNotifier::Read, &process));
process.start(defaultArgs);
app.exec();
- close(serverSocket);
+ if (!fireAndForget)
+ close(serverSocket);
return 0;
}