forked from qt-creator/qt-creator
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 <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -92,8 +92,11 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FilePath &fi
|
|||||||
projectItem->setMainFile(mainFileProperty.value.toString());
|
projectItem->setMainFile(mainFileProperty.value.toString());
|
||||||
|
|
||||||
const auto importPathsProperty = rootNode->property(QLatin1String("importPaths"));
|
const auto importPathsProperty = rootNode->property(QLatin1String("importPaths"));
|
||||||
if (importPathsProperty.isValid())
|
if (importPathsProperty.isValid()) {
|
||||||
projectItem->setImportPaths(importPathsProperty.value.toStringList());
|
QStringList list = importPathsProperty.value.toStringList();
|
||||||
|
list.removeAll(".");
|
||||||
|
projectItem->setImportPaths(list);
|
||||||
|
}
|
||||||
|
|
||||||
const auto fileSelectorsProperty = rootNode->property(QLatin1String("fileSelectors"));
|
const auto fileSelectorsProperty = rootNode->property(QLatin1String("fileSelectors"));
|
||||||
if (fileSelectorsProperty.isValid())
|
if (fileSelectorsProperty.isValid())
|
||||||
|
Reference in New Issue
Block a user