Docker: Fix searching for clangd

Environment::searchInPath() does not know from which device it came.
Therefore it will take the PATH variable as it is ( without the
device://... prefix ) and search for files on the local device.

Change-Id: Iecddb5ee1beb4ac821a9ac592f6edb1fc0f68b54
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-02-09 08:20:01 +01:00
parent 5782c7e6f3
commit f06bc4ab5a

View File

@@ -182,10 +182,13 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
logView->clear();
dockerDevice->updateContainerAccess();
const FilePath clangdPath = dockerDevice->systemEnvironment()
.searchInPath("clangd", {}, [](const FilePath &clangd) {
return Utils::checkClangdVersion(clangd);
});
const FilePath clangdPath = dockerDevice->filePath("clangd")
.searchInPath({},
FilePath::AppendToPath,
[](const FilePath &clangd) {
return Utils::checkClangdVersion(clangd);
});
if (!clangdPath.isEmpty())
m_clangdExecutable->setFilePath(clangdPath);