From 1a3998e51c7a9de039001dfabdada8e6024d8b61 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 4 Jun 2025 13:26:38 +0200 Subject: [PATCH] QmlDesigner: Skip Dependencies folder for resources This folder is only part of the CMake project. Task-number: QDS-15037 Pick-to: qds/4.7 Change-Id: Ia7d723adfb54f42205b8dcdcb601127508cd7dc1 Reviewed-by: Tim Jenssen --- .../propertyeditor/fileresourcesmodel.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp index d45560fe9ec..8bc2bb11d2d 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp @@ -216,6 +216,22 @@ QVariant FileResourcesModel::modelNodeBackend() const return QVariant(); } +static bool checkIgnoreFile(const QString &fileName) +{ + QFileInfo info(fileName); + + QDir currentDir = info.dir(); + + while (!currentDir.isRoot() && currentDir.path().contains("Dependencies")) { + if (QFileInfo(currentDir.absoluteFilePath("ignore-in-qds")).exists()) + return true; + + currentDir.cdUp(); + } + + return false; +} + static bool filterMetaIcons(const QString &fileName) { QFileInfo info(fileName); @@ -254,6 +270,10 @@ void FileResourcesModel::refreshModel() QDirIterator it(dirPath.absolutePath(), filterList, QDir::Files, QDirIterator::Subdirectories); while (it.hasNext()) { const QString absolutePath = it.next(); + + if (checkIgnoreFile(absolutePath)) + continue; + if (filterMetaIcons(absolutePath)) { const QString relativeFilePath = m_docPath.relativeFilePath(absolutePath); m_model.append(