McuSupport: Use allOutput()

Instead of self constructed mixture of output and error.

Change-Id: I3937a861f6e629f5613cd365486386e2a2db29b3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-06-29 17:36:36 +02:00
parent 46f751e61d
commit c14f30a99b

View File

@@ -60,22 +60,20 @@ McuPackageExecutableVersionDetector::McuPackageExecutableVersionDetector(
QString McuPackageExecutableVersionDetector::parseVersion(const FilePath &packagePath) const
{
if (m_detectionPath.isEmpty() || m_detectionRegExp.isEmpty())
return QString();
return {};
const FilePath binaryPath = packagePath / m_detectionPath.path();
if (!binaryPath.exists())
return QString();
return {};
const int timeout = 3000; // usually runs below 1s, but we want to be on the safe side
QtcProcess process;
process.setCommand({binaryPath, m_detectionArgs});
process.start();
if (!process.waitForFinished(timeout) || process.result() != ProcessResult::FinishedWithSuccess)
return QString();
return {};
const QString processOutput = QString::fromUtf8(
process.readAllStandardOutput().append(process.readAllStandardError()));
return matchRegExp(processOutput, m_detectionRegExp);
return matchRegExp(process.allOutput(), m_detectionRegExp);
}
McuPackageXmlVersionDetector::McuPackageXmlVersionDetector(const QString &filePattern,