QmlDesigner: Allow all asset folders except for import folders

...so that assets from imported bridge content appear in the assets
library.

Fixes: QDS-4842
Change-Id: I8f8e685ffd6e02e885eccfc0b29f2d81f989984a
Reviewed-by: Miina Puuronen <miina.puuronen@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Mahmoud Badri
2021-08-18 00:25:48 +03:00
parent 9539aff27d
commit 2e652405cd

View File

@@ -226,7 +226,7 @@ void ItemLibraryAssetsModel::refresh()
void ItemLibraryAssetsModel::setRootPath(const QString &path)
{
static const QStringList supportedTopLevelDirs {"images", "sounds", "fonts", "assets", "shaders"};
static const QStringList ignoredTopLevelDirs {"imports", "asset_imports"};
m_fileSystemWatcher->removeDirectories(m_fileSystemWatcher->directories());
m_fileSystemWatcher->removeFiles(m_fileSystemWatcher->files());
@@ -256,7 +256,7 @@ void ItemLibraryAssetsModel::setRootPath(const QString &path)
while (itDirs.hasNext()) {
QDir subDir = itDirs.next();
if (currDepth == 1 && !supportedTopLevelDirs.contains(subDir.dirName()))
if (currDepth == 1 && ignoredTopLevelDirs.contains(subDir.dirName()))
continue;
ItemLibraryAssetsDir *assetsDir = new ItemLibraryAssetsDir(subDir.path(), currDepth, loadExpandedState(subDir.path()), currAssetsDir);