McuSupport: FilePath::fromString -> fromUserInput changes

Prevent non-portable dir delimiters from getting into a FilePath.

Change-Id: I78e4a98e03ffe95e3cef70c9c499af28fa33c25c
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2021-09-27 22:12:34 +02:00
parent ef545260cd
commit f88c885d44
2 changed files with 5 additions and 5 deletions

View File

@@ -62,14 +62,13 @@ QString McuPackageExecutableVersionDetector::parseVersion(const QString &package
if (m_detectionPath.isEmpty() || m_detectionRegExp.isEmpty())
return QString();
QString binaryPath = QDir::toNativeSeparators(packagePath + "/" + m_detectionPath);
if (!Utils::FilePath::fromString(binaryPath).exists())
const Utils::FilePath binaryPath = Utils::FilePath::fromString(packagePath) / m_detectionPath;
if (!binaryPath.exists())
return QString();
const int execTimeout = 3000; // usually runs below 1s, but we want to be on the safe side
QProcess binaryProcess;
binaryProcess.start(binaryPath, m_detectionArgs);
binaryProcess.start(binaryPath.toString(), m_detectionArgs);
if (!binaryProcess.waitForStarted())
return QString();
binaryProcess.waitForFinished(execTimeout);