diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index 8be7eda52ae..8d04c3738c5 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -107,8 +107,6 @@ public: // Keep track whether we need to emit a finished signal bool m_processRunning = false; - qint64 m_listeningPid = 0; - // Remote QString m_remoteErrorString; QProcess::ProcessError m_remoteError = QProcess::UnknownError; @@ -180,7 +178,6 @@ void ApplicationLauncherPrivate::stop() if (!isRunning()) return; QTC_ASSERT(m_process, return); - m_listeningPid = 0; m_process->stopProcess(); QTimer::singleShot(100, this, [this] { emit q->finished(); }); } else { @@ -249,7 +246,6 @@ void ApplicationLauncherPrivate::handleLocalDone() if (error == QProcess::UnknownError) { m_exitCode = m_process->exitCode(); m_exitStatus = m_process->exitStatus(); - m_listeningPid = 0; emit q->finished(); return; } @@ -304,21 +300,17 @@ void ApplicationLauncherPrivate::cannotRetrieveLocalDebugOutput() { #ifdef Q_OS_WIN disconnect(WinDebugInterface::instance(), nullptr, this, nullptr); - emit q->appendMessage(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput(), ErrorMessageFormat); + emit q->appendMessage(ApplicationLauncher::tr("Cannot retrieve debugging output.") + + QLatin1Char('\n'), ErrorMessageFormat); #endif } void ApplicationLauncherPrivate::checkLocalDebugOutput(qint64 pid, const QString &message) { - if (m_listeningPid == pid) + if (applicationPID() == pid) emit q->appendMessage(message, DebugFormat); } -QString ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput() -{ - return tr("Cannot retrieve debugging output.") + QLatin1Char('\n'); -} - int ApplicationLauncher::exitCode() const { return d->m_exitCode; @@ -411,12 +403,7 @@ void ApplicationLauncherPrivate::start() else m_outputCodec = QTextCodec::codecForName("utf8"); - connect(m_process.get(), &QtcProcess::started, this, [this] { - // The local bit affects only WinDebugInterface. - if (m_isLocal) - m_listeningPid = applicationPID(); - emit q->started(); - }); + connect(m_process.get(), &QtcProcess::started, q, &ApplicationLauncher::started); m_process->setProcessChannelMode(m_processChannelMode); if (m_processChannelMode == QProcess::SeparateChannels) { diff --git a/src/plugins/projectexplorer/applicationlauncher.h b/src/plugins/projectexplorer/applicationlauncher.h index be0b3432351..170f3372505 100644 --- a/src/plugins/projectexplorer/applicationlauncher.h +++ b/src/plugins/projectexplorer/applicationlauncher.h @@ -64,8 +64,6 @@ public: QString errorString() const; QProcess::ProcessError error() const; - static QString msgWinCannotRetrieveDebuggingOutput(); - int exitCode() const; QProcess::ExitStatus exitStatus() const;