From 60b0d88df92482f29ceda67ad383fe37b7bef30a Mon Sep 17 00:00:00 2001 From: Semih Yavuz Date: Wed, 10 Jul 2024 15:51:38 +0200 Subject: [PATCH] Fix warning message due to incorrect qmlls path Don't try to start qmlls if the found path doesn't exist. When there is no Qt version found in the project (this happens when you open a qml file without providing its build folder, or open it without the project info so no linked Qt version is found) we might end up with incorrect path where no actual qml executable exist for that path. Check the existence of the binary before assigning it as the path for qmlls. Fixes: QTCREATORBUG-31207 Change-Id: I626ace796401e72462eb850d4bd88c1ef51cf53a Reviewed-by: Christian Stenger Reviewed-by: Sami Shalayel --- src/plugins/qmljseditor/qmljseditordocument.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 44c45f56dd3..53c064a99cf 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -751,7 +751,7 @@ static Utils::FilePath qmllsForFile(const Utils::FilePath &file, && QVersionNumber::fromString(pInfo.qtVersionString) < settings.mininumQmllsVersion) { return {}; } - return pInfo.qmllsPath; + return pInfo.qmllsPath.exists() ? pInfo.qmllsPath : Utils::FilePath(); } void QmlJSEditorDocumentPrivate::settingsChanged()