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
|
||||
{
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user