diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-12-20 10:41:57 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-12-20 13:09:19 +0000 |
commit | 20a5aa889f5c455db80b91b861b8ee6891a58913 (patch) | |
tree | 1c3e9e89ae26338f5522b7c46ca554aaa97b8d62 /src/plugins/projectexplorer/projecttree.cpp | |
parent | a5785e678e56d4711462795ad9639a6d0a4b207a (diff) |
Revert "ProjectTree: Add per-node "Expand" and "Collapse" actions"
This reverts commit a5785e678e56d4711462795ad9639a6d0a4b207a.
These actions are already available from the standard tree view UI...
Change-Id: If8dfe755ee450a89588ec944ae6ff7601250cdde
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/projecttree.cpp')
-rw-r--r-- | src/plugins/projectexplorer/projecttree.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/plugins/projectexplorer/projecttree.cpp b/src/plugins/projectexplorer/projecttree.cpp index d22541872c3..b42da7ad66c 100644 --- a/src/plugins/projectexplorer/projecttree.cpp +++ b/src/plugins/projectexplorer/projecttree.cpp @@ -154,7 +154,7 @@ void ProjectTree::update() ProjectTreeWidget *focus = m_focusForContextMenu; static QPointer<ProjectTreeWidget> lastFocusedProjectTreeWidget; if (!focus) { - focus = currentWidget(); + focus = Utils::findOrDefault(m_projectTreeWidgets, &ProjectTree::hasFocus); lastFocusedProjectTreeWidget = focus; } if (!focus) @@ -284,27 +284,15 @@ void ProjectTree::sessionAndTreeChanged() emit treeChanged(); } -void ProjectTree::collapseCurrentNode() -{ - if (const auto w = currentWidget()) - w->collapseCurrentNode(); -} - -void ProjectTree::expandCurrentNode() -{ - if (const auto w = currentWidget()) - w->expandCurrentNode(); -} - void ProjectTree::collapseAll() { - if (const auto w = currentWidget()) + if (auto w = Utils::findOrDefault(s_instance->m_projectTreeWidgets, &ProjectTree::hasFocus)) w->collapseAll(); } void ProjectTree::expandAll() { - if (const auto w = currentWidget()) + if (auto w = Utils::findOrDefault(s_instance->m_projectTreeWidgets, &ProjectTree::hasFocus)) w->expandAll(); } @@ -356,11 +344,6 @@ bool ProjectTree::hasFocus(ProjectTreeWidget *widget) || s_instance->m_focusForContextMenu == widget); } -ProjectTreeWidget *ProjectTree::currentWidget() const -{ - return findOrDefault(m_projectTreeWidgets, &ProjectTree::hasFocus); -} - void ProjectTree::showContextMenu(ProjectTreeWidget *focus, const QPoint &globalPos, Node *node) { QMenu *contextMenu = nullptr; |