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.
This commit is contained in:
parent
47706e9480
commit
9a1641e8ab
|
@ -47,6 +47,12 @@ TreeItem *TaskTree::_create_tree(const Ref<BTTask> &p_task, TreeItem *p_parent,
|
||||||
_create_tree(p_task->get_child(i), item);
|
_create_tree(p_task->get_child(i), item);
|
||||||
}
|
}
|
||||||
_update_item(item);
|
_update_item(item);
|
||||||
|
|
||||||
|
// update TreeSearch if root task was created
|
||||||
|
if (tree->get_root() == item){
|
||||||
|
tree_search->update_search(tree);
|
||||||
|
}
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +132,6 @@ void TaskTree::_update_tree() {
|
||||||
for (const Ref<BTTask> &task : selection) {
|
for (const Ref<BTTask> &task : selection) {
|
||||||
add_selection(task);
|
add_selection(task);
|
||||||
}
|
}
|
||||||
tree_search->update_search(tree);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeItem *TaskTree::_find_item(const Ref<BTTask> &p_task) const {
|
TreeItem *TaskTree::_find_item(const Ref<BTTask> &p_task) const {
|
||||||
|
|
Loading…
Reference in New Issue