Use qtcbuildhelper for starting the build process on Windows.

Task-number: QTCREATORBUG-4558

Change-Id: Ib6f5be80f034135bbd8c45a22e223e758cc7e7b1
Reviewed-on: http://codereview.qt.nokia.com/2555
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Joerg Bornemann
2011-08-03 12:04:46 +02:00
parent c9f7d00975
commit 566d29f8b3
4 changed files with 41 additions and 1 deletions

View File

@@ -36,6 +36,10 @@
#include <QtCore/QDir>
#include <QtCore/QDebug>
#ifdef Q_OS_WIN
#include <qt_windows.h>
#endif
using namespace Utils;
/*!
@@ -663,6 +667,8 @@ void QtcProcess::start()
QString arguments;
prepareCommand(m_command, m_arguments, &command, &arguments, &env, &workDir);
setNativeArguments(arguments);
if (m_useCtrlCStub)
command.prepend(QLatin1Char('"') + QCoreApplication::applicationDirPath() + QLatin1String("/qtcbuildhelper.exe\" "));
QProcess::start(command, QStringList());
#else
QStringList arguments;
@@ -677,6 +683,30 @@ void QtcProcess::start()
#endif
}
#ifdef Q_OS_WIN
BOOL CALLBACK sendShutDownMessageToAllWindowsOfProcess_enumWnd(HWND hwnd, LPARAM lParam)
{
static UINT uiShutDownMessage = RegisterWindowMessage(L"qtcbuildhelper_shutdown");
DWORD dwProcessID;
GetWindowThreadProcessId(hwnd, &dwProcessID);
if (lParam == dwProcessID) {
SendNotifyMessage(hwnd, uiShutDownMessage, 0, 0);
return FALSE;
}
return TRUE;
}
#endif
void QtcProcess::terminate()
{
#ifdef Q_OS_WIN
if (m_useCtrlCStub)
EnumWindows(sendShutDownMessageToAllWindowsOfProcess_enumWnd, pid()->dwProcessId);
else
#endif
QProcess::terminate();
}
#ifdef Q_OS_WIN
// This function assumes that the resulting string will be quoted.