From 4fa399fbcb2222d8fed9e3353631cbdb9a761874 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 4 Feb 2022 16:10:32 +0100 Subject: [PATCH] QmlProject: Do not allow "." in importPaths Adding the root folder to importPaths can create all kind of issues and is not supported. Change-Id: I03fe8924f08b11704fc472ed9cfa0b765ab7cf06 Reviewed-by: Miikka Heikkinen --- .../qmlprojectmanager/fileformat/qmlprojectfileformat.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp index 0b637e24a74..710f34b445b 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp @@ -92,8 +92,11 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FilePath &fi projectItem->setMainFile(mainFileProperty.value.toString()); const auto importPathsProperty = rootNode->property(QLatin1String("importPaths")); - if (importPathsProperty.isValid()) - projectItem->setImportPaths(importPathsProperty.value.toStringList()); + if (importPathsProperty.isValid()) { + QStringList list = importPathsProperty.value.toStringList(); + list.removeAll("."); + projectItem->setImportPaths(list); + } const auto fileSelectorsProperty = rootNode->property(QLatin1String("fileSelectors")); if (fileSelectorsProperty.isValid())