From 3d38541b14a7e8c3b0c080f3bd2dfa6100792bb7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 16 May 2014 15:57:02 +0200 Subject: [PATCH] disable Ctrl-C stub in debug build Activating the controlcstub in a debug build will send Ctrl-C to Qt Creator too, because he stub and Qt Creator share the same Windows. We're disabling the stub in debug builds. Cancelling a build still works but takes a bit longer. Task-number: QTCREATORBUG-11995 Change-Id: I766c2eac1f07205c411a7e4164e7d73b6c0441aa Reviewed-by: Friedemann Kleint --- src/libs/utils/qtcprocess.cpp | 10 ++++++++++ src/libs/utils/qtcprocess.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp index 5410e75aec5..210a8d840c6 100644 --- a/src/libs/utils/qtcprocess.cpp +++ b/src/libs/utils/qtcprocess.cpp @@ -671,6 +671,16 @@ bool QtcProcess::prepareCommand(const QString &command, const QString &arguments return true; } +void QtcProcess::setUseCtrlCStub(bool enabled) +{ + // Do not use the stub in debug mode. Activating the stub will shut down + // Qt Creator otherwise, because they share the same Windows console. + // See QTCREATORBUG-11995 for details. +#ifndef QT_DEBUG + m_useCtrlCStub = enabled; +#endif +} + void QtcProcess::start() { Environment env; diff --git a/src/libs/utils/qtcprocess.h b/src/libs/utils/qtcprocess.h index ca1dff19fcd..9197464a099 100644 --- a/src/libs/utils/qtcprocess.h +++ b/src/libs/utils/qtcprocess.h @@ -51,7 +51,7 @@ public: { m_environment = env; m_haveEnv = true; } void setCommand(const QString &command, const QString &arguments) { m_command = command; m_arguments = arguments; } - void setUseCtrlCStub(bool enabled) { m_useCtrlCStub = enabled; } + void setUseCtrlCStub(bool enabled); void start(); void terminate(); void interrupt();