diff --git a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp index a86c4a817b1..184346a40c8 100644 --- a/src/plugins/boot2qt/qdbdevicedebugsupport.cpp +++ b/src/plugins/boot2qt/qdbdevicedebugsupport.cpp @@ -55,7 +55,7 @@ public: { setId("QdbDebuggeeRunner"); - connect(&m_launcher, &ApplicationLauncher::remoteProcessStarted, + connect(&m_launcher, &ApplicationLauncher::processStarted, this, &RunWorker::reportStarted); connect(&m_launcher, &ApplicationLauncher::finished, this, &RunWorker::reportStopped); diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp index ad027910ee5..4fa653a5052 100644 --- a/src/plugins/projectexplorer/applicationlauncher.cpp +++ b/src/plugins/projectexplorer/applicationlauncher.cpp @@ -86,7 +86,6 @@ public: void bringToForeground(); qint64 applicationPID() const; bool isRunning() const; - bool isRemoteRunning() const; // Remote void doReportError(const QString &message); @@ -229,9 +228,9 @@ bool ApplicationLauncher::isRunning() const return d->isRunning(); } -bool ApplicationLauncher::isRemoteRunning() const +bool ApplicationLauncher::isLocal() const { - return d->isRemoteRunning(); + return d->m_isLocal; } bool ApplicationLauncherPrivate::isRunning() const @@ -241,11 +240,6 @@ bool ApplicationLauncherPrivate::isRunning() const return m_guiProcess.state() != QProcess::NotRunning; } -bool ApplicationLauncherPrivate::isRemoteRunning() const -{ - return m_isLocal ? false : m_deviceProcess->state() == QProcess::Running; -} - ProcessHandle ApplicationLauncher::applicationPID() const { return ProcessHandle(d->applicationPID()); @@ -433,7 +427,7 @@ void ApplicationLauncherPrivate::start(const Runnable &runnable, const IDevice:: m_deviceProcess = device->createProcess(this); m_deviceProcess->setRunInTerminal(m_useTerminal); connect(m_deviceProcess, &DeviceProcess::started, - q, &ApplicationLauncher::remoteProcessStarted); + q, &ApplicationLauncher::processStarted); connect(m_deviceProcess, &DeviceProcess::readyReadStandardOutput, this, &ApplicationLauncherPrivate::handleRemoteStdout); connect(m_deviceProcess, &DeviceProcess::readyReadStandardError, diff --git a/src/plugins/projectexplorer/applicationlauncher.h b/src/plugins/projectexplorer/applicationlauncher.h index e7d835b25ac..a41294c9c3d 100644 --- a/src/plugins/projectexplorer/applicationlauncher.h +++ b/src/plugins/projectexplorer/applicationlauncher.h @@ -60,7 +60,7 @@ public: void stop(); bool isRunning() const; Utils::ProcessHandle applicationPID() const; - bool isRemoteRunning() const; + bool isLocal() const; QString errorString() const; QProcess::ProcessError processError() const; @@ -75,7 +75,6 @@ signals: void error(QProcess::ProcessError error); void reportError(const QString &errorOutput); - void remoteProcessStarted(); void finished(bool success); private: diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 5096c306b92..cd672e977ee 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1263,11 +1263,7 @@ void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstP reportStopped(); }); - connect(&m_launcher, &ApplicationLauncher::processStarted, - this, [this] { - appendMessage("Application launcher started", Utils::NormalMessageFormat); -// reportStarted(); - }); + connect(&m_launcher, &ApplicationLauncher::processStarted, this, &RunWorker::reportStarted); connect(&m_launcher, &ApplicationLauncher::processExited, this, [this] { @@ -1275,11 +1271,6 @@ void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstP reportStopped(); }); - connect(&m_launcher, &ApplicationLauncher::remoteProcessStarted, - this, [this] { - reportStarted(); - }); - connect(&m_launcher, &ApplicationLauncher::appendMessage, this, &RunWorker::appendMessage); m_launcher.start(runnable, device); diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index a6bf8817eea..d29a2fd917a 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -49,6 +49,7 @@ public: bool run(); void closed(bool success); + void processStarted(); void localProcessStarted(); void remoteProcessStarted(); void findPidOutputReceived(const QString &out, Utils::OutputFormat format); @@ -117,7 +118,7 @@ bool ValgrindRunner::Private::run() connect(&m_valgrindProcess, &ApplicationLauncher::processExited, this, &ValgrindRunner::Private::closed); connect(&m_valgrindProcess, &ApplicationLauncher::processStarted, - this, &ValgrindRunner::Private::localProcessStarted); + this, &ValgrindRunner::Private::processStarted); connect(&m_valgrindProcess, &ApplicationLauncher::error, q, &ValgrindRunner::processError); connect(&m_valgrindProcess, &ApplicationLauncher::appendMessage, @@ -125,9 +126,6 @@ bool ValgrindRunner::Private::run() connect(&m_valgrindProcess, &ApplicationLauncher::finished, q, &ValgrindRunner::finished); - connect(&m_valgrindProcess, &ApplicationLauncher::remoteProcessStarted, - this, &ValgrindRunner::Private::remoteProcessStarted); - if (HostOsInfo::isMacHost()) // May be slower to start but without it we get no filenames for symbols. cmd.addArg("--dsymutil=yes"); @@ -154,6 +152,14 @@ bool ValgrindRunner::Private::run() return true; } +void ValgrindRunner::Private::processStarted() +{ + if (m_valgrindProcess.isLocal()) + localProcessStarted(); + else + remoteProcessStarted(); +} + void ValgrindRunner::Private::localProcessStarted() { qint64 pid = m_valgrindProcess.applicationPID().pid();