diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp index 2cfa852e6f0..acf03739726 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp @@ -39,9 +39,6 @@ #include #include #include -#include "qmldesignerplugin.h" -#include -#include #include #include @@ -155,14 +152,8 @@ void ItemLibraryAssetsModel::setRootPath(const QString &path) m_fileSystemWatcher->removeDirectories(m_fileSystemWatcher->directories()); m_fileSystemWatcher->removeFiles(m_fileSystemWatcher->files()); - DesignDocument *currDesignDoc = QmlDesignerPlugin::instance()->currentDesignDocument(); - if (!currDesignDoc) // happens sometimes on QDS shutdown - return; - ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile(currDesignDoc->fileName()); - QString projectName = project ? project->displayName() : ""; - std::function parseDirRecursive; - parseDirRecursive = [this, &parseDirRecursive, &projectName](ItemLibraryAssetsDir *currAssetsDir, int currDepth) { + parseDirRecursive = [this, &parseDirRecursive](ItemLibraryAssetsDir *currAssetsDir, int currDepth) { m_fileSystemWatcher->addDirectory(currAssetsDir->dirPath(), Utils::FileSystemWatcher::WatchAllChanges); QDir dir(currAssetsDir->dirPath()); @@ -186,10 +177,8 @@ void ItemLibraryAssetsModel::setRootPath(const QString &path) while (itDirs.hasNext()) { QDir subDir = itDirs.next(); - if (subDir.isEmpty() || projectName == subDir.dirName() - || (currDepth == 1 && !supportedTopLevelDirs.contains(subDir.dirName()))) { + if (currDepth == 1 && !supportedTopLevelDirs.contains(subDir.dirName())) continue; - } ItemLibraryAssetsDir *assetsDir = new ItemLibraryAssetsDir(subDir.path(), currDepth, loadExpandedState(subDir.path()), currAssetsDir); currAssetsDir->addDir(assetsDir);