Add one method-const qualifier to TreeSearchPanel

This commit is contained in:
Alexander Montag 2024-09-29 16:26:18 +00:00
parent 585d9663d6
commit f7d546fc3c
No known key found for this signature in database
GPG Key ID: 07FE50B35A2B7524
2 changed files with 4 additions and 4 deletions

View File

@ -511,7 +511,7 @@ TreeSearchPanel::TreeSearchPanel() {
set_visible(false); set_visible(false);
} }
TreeSearch::TreeSearchMode TreeSearchPanel::get_search_mode() { TreeSearch::TreeSearchMode TreeSearchPanel::get_search_mode() const{
if (!check_button_filter_highlight || !check_button_filter_highlight->is_pressed()) { if (!check_button_filter_highlight || !check_button_filter_highlight->is_pressed()) {
return TreeSearch::TreeSearchMode::HIGHLIGHT; return TreeSearch::TreeSearchMode::HIGHLIGHT;
} }

View File

@ -56,7 +56,7 @@ private:
// linearized ordering of tree items. // linearized ordering of tree items.
Vector<TreeItem *> ordered_tree_items; Vector<TreeItem *> ordered_tree_items;
// entires that match the search mask. // entires that match the search mask.
// TODO: Decide if this can be removed. It can be implicitly infered from number_matches. // TODO: Decide if this can be removed. It can be implicitly inferred from number_matches.
Vector<TreeItem *> matching_entries; Vector<TreeItem *> matching_entries;
// number of descendant matches for each tree item. // number of descendant matches for each tree item.
HashMap<TreeItem *, int> number_matches; HashMap<TreeItem *, int> number_matches;
@ -90,7 +90,7 @@ private:
void _select_first_match(); void _select_first_match();
void _select_next_match(); void _select_next_match();
// TODO: make p_vec `const` once Vector::bsearch is const. See: https://github.com/godotengine/godot/pull/90341 // TODO: make p_vec ref `const` once Vector::bsearch is const. See: https://github.com/godotengine/godot/pull/90341
template <typename T> template <typename T>
bool _vector_has_bsearch(Vector<T *> &p_vec, T *element) const; bool _vector_has_bsearch(Vector<T *> &p_vec, T *element) const;
@ -130,7 +130,7 @@ protected:
static void _bind_methods(); static void _bind_methods();
public: public:
TreeSearch::TreeSearchMode get_search_mode(); TreeSearch::TreeSearchMode get_search_mode() const;
String get_text() const; String get_text() const;
void show_and_focus(); void show_and_focus();
TreeSearchPanel(); TreeSearchPanel();