From 9a1641e8ab608ce4d0c94ce7dd108ba128351eed Mon Sep 17 00:00:00 2001 From: Alexander Montag Date: Fri, 27 Sep 2024 15:24:14 +0000 Subject: [PATCH] Move TreeSearch::update_tree in TaskTree from update_tree Catches all cases where the tree is modified. Also those, where for example the tab is switched. --- editor/task_tree.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/task_tree.cpp b/editor/task_tree.cpp index 5e56271..31f0fe8 100644 --- a/editor/task_tree.cpp +++ b/editor/task_tree.cpp @@ -47,6 +47,12 @@ TreeItem *TaskTree::_create_tree(const Ref &p_task, TreeItem *p_parent, _create_tree(p_task->get_child(i), item); } _update_item(item); + + // update TreeSearch if root task was created + if (tree->get_root() == item){ + tree_search->update_search(tree); + } + return item; } @@ -126,7 +132,6 @@ void TaskTree::_update_tree() { for (const Ref &task : selection) { add_selection(task); } - tree_search->update_search(tree); } TreeItem *TaskTree::_find_item(const Ref &p_task) const {