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