Utils: Fix FilePath::searchInPath remotely

Change-Id: I49bd7fd96427b55d28743eab277c72710a2ac6c0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2022-12-02 13:27:28 +01:00
parent 067d02f82d
commit d3487b1bde
2 changed files with 11 additions and 13 deletions

View File

@@ -140,13 +140,10 @@ static FilePath searchInDirectory(const QStringList &execs,
if (directory.isEmpty() || alreadyChecked.count() == checkedCount)
return FilePath();
const QString dir = directory.toString();
QFileInfo fi;
for (const QString &exec : execs) {
fi.setFile(dir, exec);
if (fi.isFile() && fi.isExecutable())
return FilePath::fromString(fi.absoluteFilePath());
const FilePath filePath = directory.pathAppended(exec);
if (filePath.isExecutableFile())
return filePath;
}
return FilePath();
}