aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/applicationlauncher.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2016-03-03 16:10:04 +0100
committerEike Ziller <eike.ziller@theqtcompany.com>2016-03-03 16:10:04 +0100
commitf4e87a7e0cbc62738bc00733a3655486c9a26959 (patch)
tree768e41482b57f0b37813b4b5b888c8aae51b230e /src/plugins/projectexplorer/applicationlauncher.cpp
parent0aeb654685c24c528dd482c799cad8e008c130ef (diff)
parentfc5768212021f7fb9f5af2389b1bdeefed5ca4a6 (diff)
Merge remote-tracking branch 'origin/3.6' into 4.0
Conflicts: src/plugins/projectexplorer/applicationlauncher.cpp src/plugins/projectexplorer/applicationlauncher.h src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp src/plugins/qmlprofiler/qmlprofilertool.cpp src/plugins/qtsupport/uicodemodelsupport.cpp src/plugins/qtsupport/uicodemodelsupport.h Change-Id: I6f6ae77422d99f4f422b108ade6b64273df9dd57
Diffstat (limited to 'src/plugins/projectexplorer/applicationlauncher.cpp')
-rw-r--r--src/plugins/projectexplorer/applicationlauncher.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp
index 093cec6ecb..a3d8b4534b 100644
--- a/src/plugins/projectexplorer/applicationlauncher.cpp
+++ b/src/plugins/projectexplorer/applicationlauncher.cpp
@@ -38,6 +38,7 @@
#include <utils/qtcprocess.h>
#include <QTextCodec>
+#include <QTimer>
#ifdef Q_OS_WIN
#include <windows.h>
@@ -76,7 +77,9 @@ struct ApplicationLauncherPrivate {
QTextCodec::ConverterState m_outputCodecState;
QTextCodec::ConverterState m_errorCodecState;
// Keep track whether we need to emit a finished signal
- bool m_processRunning;
+ bool m_processRunning = false;
+
+ qint64 m_listeningPid = 0;
};
ApplicationLauncherPrivate::ApplicationLauncherPrivate() :
@@ -110,7 +113,7 @@ ApplicationLauncher::ApplicationLauncher(QObject *parent)
d->m_consoleProcess.setSettings(Core::ICore::settings());
#endif
connect(&d->m_consoleProcess, &Utils::ConsoleProcess::processStarted,
- this, &ApplicationLauncher::processStarted);
+ this, &ApplicationLauncher::handleProcessStarted);
connect(&d->m_consoleProcess, &Utils::ConsoleProcess::processError,
this, &ApplicationLauncher::consoleProcessError);
connect(&d->m_consoleProcess, &Utils::ConsoleProcess::processStopped,
@@ -273,19 +276,22 @@ void ApplicationLauncher::cannotRetrieveDebugOutput()
void ApplicationLauncher::checkDebugOutput(qint64 pid, const QString &message)
{
- if (applicationPID() == pid)
+ if (d->m_listeningPid == pid)
emit appendMessage(message, Utils::DebugFormat);
}
void ApplicationLauncher::processDone(int exitCode, QProcess::ExitStatus status)
{
- emit processExited(exitCode, status);
+ QTimer::singleShot(100, this, [this, exitCode, status]() {
+ d->m_listeningPid = 0;
+ emit processExited(exitCode, status);
+ });
}
void ApplicationLauncher::bringToForeground()
{
emit bringToForegroundRequested(applicationPID());
- emit processStarted();
+ handleProcessStarted();
}
QString ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput()
@@ -293,4 +299,10 @@ QString ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput()
return tr("Cannot retrieve debugging output.") + QLatin1Char('\n');
}
+void ApplicationLauncher::handleProcessStarted()
+{
+ d->m_listeningPid = applicationPID();
+ emit processStarted();
+}
+
} // namespace ProjectExplorer