diff options
author | dt <qtc-committer@nokia.com> | 2010-11-18 17:31:30 +0100 |
---|---|---|
committer | dt <qtc-committer@nokia.com> | 2010-11-18 17:47:01 +0100 |
commit | bdc0e2924135328deaa4ac3635880dbd1348ff2c (patch) | |
tree | 2b241b3c34212602eff1ac62a810dae9cf5f8108 /src/plugins/projectexplorer/projectmodels.cpp | |
parent | 1b1da8ae368022e9cd59ffdf5896fa4b54894b0d (diff) | |
download | qt-creator-bdc0e2924135328deaa4ac3635880dbd1348ff2c.tar.gz |
FlatModel: The simplified tree did not react to hasBuildTarget changes
Task-Nr: QTCREATORBUG-3014
Task-Nr: QTCREATORBUG-2821
Diffstat (limited to 'src/plugins/projectexplorer/projectmodels.cpp')
-rw-r--r-- | src/plugins/projectexplorer/projectmodels.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index f57acb0c08..f7440b53bc 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -145,6 +145,12 @@ FlatModel::FlatModel(SessionNode *rootNode, QObject *parent) NodesWatcher *watcher = new NodesWatcher(this); m_rootNode->registerWatcher(watcher); + connect(watcher, SIGNAL(aboutToHasBuildTargetsChanged(ProjectExplorer::ProjectNode*)), + this, SLOT(aboutToHasBuildTargetsChanged(ProjectExplorer::ProjectNode*))); + + connect(watcher, SIGNAL(hasBuildTargetsChanged(ProjectExplorer::ProjectNode*)), + this, SLOT(hasBuildTargetsChanged(ProjectExplorer::ProjectNode*))); + connect(watcher, SIGNAL(foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &)), this, SLOT(foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &))); connect(watcher, SIGNAL(foldersAdded()), @@ -508,7 +514,6 @@ bool FlatModel::filter(Node *node) const if (m_filterGeneratedFiles) isHidden = fileNode->isGenerated(); } - return isHidden; } @@ -694,6 +699,31 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList) } } +void FlatModel::aboutToHasBuildTargetsChanged(ProjectExplorer::ProjectNode* node) +{ + if (!m_filterProjects) + return; + FolderNode *folder = visibleFolderNode(node->parentFolderNode()); + QList<Node *> newNodeList = childNodes(folder, QSet<Node *>() << node); + removed(folder, newNodeList); + + QList<Node *> staleFolders; + recursiveAddFolderNodesImpl(node, &staleFolders); + foreach (Node *n, staleFolders) + if (FolderNode *fn = qobject_cast<FolderNode *>(n)) + m_childNodes.remove(fn); +} + +void FlatModel::hasBuildTargetsChanged(ProjectExplorer::ProjectNode *node) +{ + if (!m_filterProjects) + return; + // we are only interested if we filter + FolderNode *folder = visibleFolderNode(node->parentFolderNode()); + QList<Node *> newNodeList = childNodes(folder); + added(folder, newNodeList); +} + void FlatModel::foldersAboutToBeAdded(FolderNode *parentFolder, const QList<FolderNode*> &newFolders) { Q_UNUSED(newFolders) |