forked from qt-creator/qt-creator
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:
@@ -226,7 +226,7 @@ void ItemLibraryAssetsModel::refresh()
|
|||||||
|
|
||||||
void ItemLibraryAssetsModel::setRootPath(const QString &path)
|
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->removeDirectories(m_fileSystemWatcher->directories());
|
||||||
m_fileSystemWatcher->removeFiles(m_fileSystemWatcher->files());
|
m_fileSystemWatcher->removeFiles(m_fileSystemWatcher->files());
|
||||||
@@ -256,7 +256,7 @@ void ItemLibraryAssetsModel::setRootPath(const QString &path)
|
|||||||
|
|
||||||
while (itDirs.hasNext()) {
|
while (itDirs.hasNext()) {
|
||||||
QDir subDir = itDirs.next();
|
QDir subDir = itDirs.next();
|
||||||
if (currDepth == 1 && !supportedTopLevelDirs.contains(subDir.dirName()))
|
if (currDepth == 1 && ignoredTopLevelDirs.contains(subDir.dirName()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ItemLibraryAssetsDir *assetsDir = new ItemLibraryAssetsDir(subDir.path(), currDepth, loadExpandedState(subDir.path()), currAssetsDir);
|
ItemLibraryAssetsDir *assetsDir = new ItemLibraryAssetsDir(subDir.path(), currDepth, loadExpandedState(subDir.path()), currAssetsDir);
|
||||||
|
Reference in New Issue
Block a user