diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2010-08-04 12:51:34 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-08-04 13:01:51 (GMT) |
commit | ad1b1fc8c19064601f993010c18adf0a01c5cf92 (patch) | |
tree | 6b701204254065366e78d02a7a54fa766d48d832 /tools/runonphone/main.cpp | |
parent | d444ca3cbc4fc3a923e67755d62d52bd5186f2f0 (diff) | |
download | Qt-ad1b1fc8c19064601f993010c18adf0a01c5cf92.zip Qt-ad1b1fc8c19064601f993010c18adf0a01c5cf92.tar.gz Qt-ad1b1fc8c19064601f993010c18adf0a01c5cf92.tar.bz2 |
runonphone - catch ctrl-c and terminate remote process before exit
Trap SIGINT, SIGTERM, SIGHUP, SIGBREAK, SIGQUIT
On receiving one of these signals, we first untrap them (so runonphone
can be killed by a 2nd ctrl-c if needed), and send a terminate to the
TRK launcher.
This will kill the remote process if it's running, then disconnect from
TRK cleanly.
Task-number: QTBUG-12444
Reviewed-by: axis
Diffstat (limited to 'tools/runonphone/main.cpp')
-rw-r--r-- | tools/runonphone/main.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp index 7767e4b..93b087b 100644 --- a/tools/runonphone/main.cpp +++ b/tools/runonphone/main.cpp @@ -51,6 +51,7 @@ #include "trksignalhandler.h" #include "serenum.h" +#include "ossignalconverter.h" void printUsage(QTextStream& outstream, QString exeName) { @@ -235,6 +236,8 @@ int main(int argc, char *argv[]) QObject::connect(&handler, SIGNAL(getRegistersAndCallStack(uint,uint)), launcher.data(), SLOT(getRegistersAndCallStack(uint,uint))); QObject::connect(launcher.data(), SIGNAL(finished()), &handler, SLOT(finished())); + QObject::connect(OsSignalConverter::instance(), SIGNAL(terminate()), launcher.data(), SLOT(terminate()), Qt::QueuedConnection); + QTimer timer; timer.setSingleShot(true); QObject::connect(&timer, SIGNAL(timeout()), &handler, SLOT(timeout())); |