forked from qt-creator/qt-creator
Utils: Send start failed if no ProcessInterface
Change-Id: I38cdce9812bcec3240e3fb4f30a1dd266a5515e9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -1251,7 +1251,19 @@ void Process::start()
|
||||
} else {
|
||||
processImpl = d->createProcessInterface();
|
||||
}
|
||||
QTC_ASSERT(processImpl, return);
|
||||
|
||||
if (!processImpl) {
|
||||
// This happens if a device does not implement the createProcessInterface() function.
|
||||
d->m_result = ProcessResult::StartFailed;
|
||||
d->m_resultData.m_exitCode = 255;
|
||||
d->m_resultData.m_exitStatus = QProcess::CrashExit;
|
||||
d->m_resultData.m_errorString = Tr::tr("Failed to create process interface for \"%1\"")
|
||||
.arg(d->m_setup.m_commandLine.toUserOutput());
|
||||
d->m_resultData.m_error = QProcess::FailedToStart;
|
||||
d->emitGuardedSignal(&Process::done);
|
||||
return;
|
||||
}
|
||||
|
||||
d->setProcessInterface(processImpl);
|
||||
d->m_state = QProcess::Starting;
|
||||
d->m_process->m_setup = d->m_setup;
|
||||
|
||||
@@ -290,7 +290,6 @@ FilePath IDevice::searchExecutable(const QString &fileName, const FilePaths &dir
|
||||
|
||||
ProcessInterface *IDevice::createProcessInterface() const
|
||||
{
|
||||
QTC_CHECK(false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user