LinuxDeviceProcess: Only look for processId on freshly started process

There may be additional output being retrieved after the process is
finished. We don't want that to get mangled by the processId mechanism.

Change-Id: I9ad3146ace66288de1a4d8f1e94b9999719862c8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2019-02-12 11:40:15 +01:00
parent c6415e2652
commit 4b5841292e

View File

@@ -42,6 +42,9 @@ LinuxDeviceProcess::LinuxDeviceProcess(const QSharedPointer<const ProjectExplore
: ProjectExplorer::SshDeviceProcess(device, parent), m_processId(0)
{
connect(this, &DeviceProcess::finished, this, [this]() {
m_processId = -1;
});
connect(this, &DeviceProcess::started, this, [this]() {
m_processId = 0;
});
}
@@ -70,7 +73,7 @@ QByteArray LinuxDeviceProcess::readAllStandardOutput()
qint64 LinuxDeviceProcess::processId() const
{
return m_processId;
return m_processId < 0 ? 0 : m_processId;
}
QString LinuxDeviceProcess::fullCommandLine(const Runnable &runnable) const