From 3eb5e0ac509def467d53df7a729e76743e235e90 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Wed, 26 Jan 2022 18:03:56 -0500 Subject: Rename String::is_subsequence_ofi to String::is_subsequence_ofn --- core/string/ustring.cpp | 2 +- core/string/ustring.h | 2 +- core/variant/variant_call.cpp | 2 +- doc/classes/String.xml | 2 +- editor/connections_dialog.cpp | 2 +- editor/create_dialog.cpp | 2 +- editor/debugger/editor_debugger_tree.cpp | 2 +- editor/editor_command_palette.cpp | 2 +- editor/editor_inspector.cpp | 2 +- editor/groups_editor.cpp | 4 ++-- editor/plugins/script_editor_plugin.cpp | 4 ++-- editor/plugins/theme_editor_plugin.cpp | 2 +- editor/quick_open.cpp | 2 +- editor/scene_tree_editor.cpp | 2 +- editor/settings_config_dialog.cpp | 4 ++-- modules/gdscript/language_server/gdscript_workspace.cpp | 2 +- modules/gridmap/grid_map_editor_plugin.cpp | 2 +- scene/gui/code_edit.cpp | 2 +- tests/core/string/test_string.h | 2 +- 19 files changed, 22 insertions(+), 22 deletions(-) diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 93b2060155..93d75ff098 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -3080,7 +3080,7 @@ bool String::is_subsequence_of(const String &p_string) const { return _base_is_subsequence_of(p_string, false); } -bool String::is_subsequence_ofi(const String &p_string) const { +bool String::is_subsequence_ofn(const String &p_string) const { return _base_is_subsequence_of(p_string, true); } diff --git a/core/string/ustring.h b/core/string/ustring.h index 4840c236c0..16d6dc5bc3 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -285,7 +285,7 @@ public: bool ends_with(const String &p_string) const; bool is_enclosed_in(const String &p_string) const; bool is_subsequence_of(const String &p_string) const; - bool is_subsequence_ofi(const String &p_string) const; + bool is_subsequence_ofn(const String &p_string) const; bool is_quoted() const; Vector bigrams() const; float similarity(const String &p_string) const; diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 8dd48a4c28..62964fba80 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1382,7 +1382,7 @@ static void _register_variant_builtin_methods() { bind_methodv(String, begins_with, static_cast(&String::begins_with), sarray("text"), varray()); bind_method(String, ends_with, sarray("text"), varray()); bind_method(String, is_subsequence_of, sarray("text"), varray()); - bind_method(String, is_subsequence_ofi, sarray("text"), varray()); + bind_method(String, is_subsequence_ofn, sarray("text"), varray()); bind_method(String, bigrams, sarray(), varray()); bind_method(String, similarity, sarray("text"), varray()); diff --git a/doc/classes/String.xml b/doc/classes/String.xml index c8e835f0f1..1a9b9ccdcc 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -285,7 +285,7 @@ Returns [code]true[/code] if this string is a subsequence of the given string. - + diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index bda558bb72..5bea793da8 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -1009,7 +1009,7 @@ void ConnectionsDock::update_tree() { PackedStringArray argnames; String filter_text = search_box->get_text(); - if (!filter_text.is_subsequence_ofi(signal_name)) { + if (!filter_text.is_subsequence_ofn(signal_name)) { continue; } diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index d0dfbc7c11..3d55f45dd6 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -178,7 +178,7 @@ void CreateDialog::_update_search() { // Filter all candidate results. Vector candidates; for (List::Element *I = type_list.front(); I; I = I->next()) { - if (empty_search || search_text.is_subsequence_ofi(I->get())) { + if (empty_search || search_text.is_subsequence_ofn(I->get())) { candidates.push_back(I->get()); } } diff --git a/editor/debugger/editor_debugger_tree.cpp b/editor/debugger/editor_debugger_tree.cpp index 29d0014b8a..41f4db541d 100644 --- a/editor/debugger/editor_debugger_tree.cpp +++ b/editor/debugger/editor_debugger_tree.cpp @@ -186,7 +186,7 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int // Apply filters. while (parent) { const bool had_siblings = item->get_prev() || item->get_next(); - if (filter.is_subsequence_ofi(item->get_text(0))) { + if (filter.is_subsequence_ofn(item->get_text(0))) { break; // Filter matches, must survive. } parent->remove_child(item); diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index 1724e87489..d13d1a6c68 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -72,7 +72,7 @@ void EditorCommandPalette::_update_command_search(const String &search_text) { r.shortcut_text = commands[r.key_name].shortcut; r.last_used = commands[r.key_name].last_used; - if (search_text.is_subsequence_ofi(r.display_name)) { + if (search_text.is_subsequence_ofn(r.display_name)) { if (!search_text.is_empty()) { r.score = _score_path(search_text, r.display_name.to_lower()); } diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index a3538d3381..d19032da8b 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2595,7 +2595,7 @@ void EditorInspector::update_tree() { // Ignore properties that do not fit the filter. if (use_filter && !filter.is_empty()) { - if (!filter.is_subsequence_ofi(path) && !filter.is_subsequence_ofi(property_label_string) && property_prefix.to_lower().find(filter.to_lower()) == -1) { + if (!filter.is_subsequence_ofn(path) && !filter.is_subsequence_ofn(property_label_string) && property_prefix.to_lower().find(filter.to_lower()) == -1) { continue; } } diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index 15455b759b..1644bb9dbe 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -71,13 +71,13 @@ void GroupDialog::_load_nodes(Node *p_current) { TreeItem *node = nullptr; NodePath path = scene_tree->get_edited_scene_root()->get_path_to(p_current); if (keep && p_current->is_in_group(selected_group)) { - if (remove_filter->get_text().is_subsequence_ofi(String(p_current->get_name()))) { + if (remove_filter->get_text().is_subsequence_ofn(String(p_current->get_name()))) { node = nodes_to_remove->create_item(remove_node_root); keep = true; } else { keep = false; } - } else if (keep && add_filter->get_text().is_subsequence_ofi(String(p_current->get_name()))) { + } else if (keep && add_filter->get_text().is_subsequence_ofn(String(p_current->get_name()))) { node = nodes_to_add->create_item(add_node_root); keep = true; } else { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 2fc4cda861..f307bbd9c6 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1878,7 +1878,7 @@ void ScriptEditor::_update_members_overview() { for (int i = 0; i < functions.size(); i++) { String filter = filter_methods->get_text(); String name = functions[i].get_slice(":", 0); - if (filter.is_empty() || filter.is_subsequence_ofi(name)) { + if (filter.is_empty() || filter.is_subsequence_ofn(name)) { members_overview->add_item(name); members_overview->set_item_metadata(members_overview->get_item_count() - 1, functions[i].get_slice(":", 1).to_int() - 1); } @@ -2128,7 +2128,7 @@ void ScriptEditor::_update_script_names() { Vector<_ScriptEditorItemData> sedata_filtered; for (int i = 0; i < sedata.size(); i++) { String filter = filter_scripts->get_text(); - if (filter.is_empty() || filter.is_subsequence_ofi(sedata[i].name)) { + if (filter.is_empty() || filter.is_subsequence_ofn(sedata[i].name)) { sedata_filtered.push_back(sedata[i]); } } diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index f95b2b40b5..611f81db33 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -2076,7 +2076,7 @@ void ThemeTypeDialog::_update_add_type_options(const String &p_filter) { Vector unique_names; for (const StringName &E : names) { // Filter out undesired values. - if (!p_filter.is_subsequence_ofi(String(E))) { + if (!p_filter.is_subsequence_ofn(String(E))) { continue; } diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index 118c016c6d..2a8ca67fe6 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -84,7 +84,7 @@ void EditorQuickOpen::_update_search() { // Filter possible candidates. Vector entries; for (int i = 0; i < files.size(); i++) { - if (empty_search || search_text.is_subsequence_ofi(files[i])) { + if (empty_search || search_text.is_subsequence_ofn(files[i])) { Entry r; r.path = files[i]; r.score = empty_search ? 0 : _score_path(search_text, files[i].to_lower()); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 4a36462d65..c755bca64f 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -411,7 +411,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll item->set_as_cursor(0); } - bool keep = (filter.is_subsequence_ofi(String(p_node->get_name()))); + bool keep = (filter.is_subsequence_ofn(String(p_node->get_name()))); for (int i = 0; i < p_node->get_child_count(); i++) { bool child_keep = _add_nodes(p_node->get_child(i), item, p_scroll_to_selected); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index 71edeefd10..c4d361bd49 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -379,7 +379,7 @@ void EditorSettingsDialog::_update_shortcuts() { // Join the text of the events with a delimiter so they can all be displayed in one cell. String events_display_string = event_strings.is_empty() ? "None" : String("; ").join(event_strings); - if (!shortcut_filter.is_subsequence_ofi(action_name) && (events_display_string == "None" || !shortcut_filter.is_subsequence_ofi(events_display_string))) { + if (!shortcut_filter.is_subsequence_ofn(action_name) && (events_display_string == "None" || !shortcut_filter.is_subsequence_ofn(events_display_string))) { continue; } @@ -428,7 +428,7 @@ void EditorSettingsDialog::_update_shortcuts() { // Shortcut Item - if (!shortcut_filter.is_subsequence_ofi(sc->get_name())) { + if (!shortcut_filter.is_subsequence_ofn(sc->get_name())) { continue; } diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index a944844226..16a107415b 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -269,7 +269,7 @@ Array GDScriptWorkspace::symbol(const Dictionary &p_params) { Vector script_symbols; E.value->get_symbols().symbol_tree_as_list(E.key, script_symbols); for (int i = 0; i < script_symbols.size(); ++i) { - if (query.is_subsequence_ofi(script_symbols[i].name)) { + if (query.is_subsequence_ofn(script_symbols[i].name)) { lsp::DocumentedSymbolInformation symbol = script_symbols[i]; symbol.location.uri = get_file_uri(symbol.location.uri); arr.push_back(symbol.to_json()); diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 320901787d..84510fc71e 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -889,7 +889,7 @@ void GridMapEditor::update_palette() { name = "#" + itos(id); } - if (!filter.is_empty() && !filter.is_subsequence_ofi(name)) { + if (!filter.is_empty() && !filter.is_subsequence_ofn(name)) { continue; } diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 8da7264b02..62e24062ba 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -2853,7 +2853,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() { completion_options_casei.push_back(option); } else if (s.is_subsequence_of(option.display)) { completion_options_subseq.push_back(option); - } else if (s.is_subsequence_ofi(option.display)) { + } else if (s.is_subsequence_ofn(option.display)) { completion_options_subseq_casei.push_back(option); } diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h index baab5ddfe7..e03a71bcb8 100644 --- a/tests/core/string/test_string.h +++ b/tests/core/string/test_string.h @@ -877,7 +877,7 @@ TEST_CASE("[String] is_subsequence_of") { String a = "is subsequence of"; CHECK(String("sub").is_subsequence_of(a)); CHECK(!String("Sub").is_subsequence_of(a)); - CHECK(String("Sub").is_subsequence_ofi(a)); + CHECK(String("Sub").is_subsequence_ofn(a)); } TEST_CASE("[String] match") { -- cgit v1.2.3