forked from qt-creator/qt-creator
ProcessInterface: Pass processId with started() signal
Pass also applicationMainThreadId optionally (Windows only). Remove two virtual accessors. Task-number: QTCREATORBUG-27358 Change-Id: I3b12b642cc3c109653276c0fbf65e7f614ce6b56 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -163,13 +163,6 @@ TerminalImpl::~TerminalImpl()
|
||||
delete d;
|
||||
}
|
||||
|
||||
qint64 TerminalImpl::applicationMainThreadID() const
|
||||
{
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
return d->m_appMainThreadId;
|
||||
return -1;
|
||||
}
|
||||
|
||||
void TerminalImpl::start()
|
||||
{
|
||||
if (isRunning())
|
||||
@@ -620,6 +613,7 @@ void TerminalImpl::readStubOutput()
|
||||
emitError(QProcess::FailedToStart,
|
||||
msgCannotExecute(m_setup->m_commandLine.executable().toUserOutput(), winErrorMessage(out.mid(9).toInt())));
|
||||
} else if (out.startsWith("thread ")) { // Windows only
|
||||
// TODO: ensure that it comes before "pid " comes
|
||||
d->m_appMainThreadId = out.mid(7).toLongLong();
|
||||
} else if (out.startsWith("pid ")) {
|
||||
// Will not need it any more
|
||||
@@ -647,7 +641,7 @@ void TerminalImpl::readStubOutput()
|
||||
emitFinished(chldStatus, QProcess::NormalExit);
|
||||
});
|
||||
|
||||
emit started();
|
||||
emit started(d->m_processId, d->m_appMainThreadId);
|
||||
} else {
|
||||
emitError(QProcess::UnknownError, msgUnexpectedOutput(out));
|
||||
TerminateProcess(d->m_pid->hProcess, (unsigned)-1);
|
||||
@@ -666,7 +660,7 @@ void TerminalImpl::readStubOutput()
|
||||
d->m_tempFile = nullptr;
|
||||
} else if (out.startsWith("pid ")) {
|
||||
d->m_processId = out.mid(4).toInt();
|
||||
emit started();
|
||||
emit started(d->m_processId);
|
||||
} else if (out.startsWith("exit ")) {
|
||||
emitFinished(out.mid(5).toInt(), QProcess::NormalExit);
|
||||
} else if (out.startsWith("crash ")) {
|
||||
@@ -728,11 +722,6 @@ void TerminalImpl::cleanupStub()
|
||||
#endif
|
||||
}
|
||||
|
||||
qint64 TerminalImpl::processId() const
|
||||
{
|
||||
return d->m_processId;
|
||||
}
|
||||
|
||||
void TerminalImpl::emitError(QProcess::ProcessError error, const QString &errorString)
|
||||
{
|
||||
d->m_result.m_error = error;
|
||||
|
||||
Reference in New Issue
Block a user