From fc076ece3ddecd44a62dc0febed7baee47f2eede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 8 Feb 2022 10:14:58 +0100 Subject: Revert "Add missing SNAME macro optimization to all theme methods call" This reverts commit a988fad9a092053434545c32afae91ccbdfbe792. As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used everywhere but only in critical code paths. For theme methods specifically, it was by design that only getters use `SNAME` and not setters. --- .../editor/visual_script_property_selector.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/visual_script/editor/visual_script_property_selector.cpp') diff --git a/modules/visual_script/editor/visual_script_property_selector.cpp b/modules/visual_script/editor/visual_script_property_selector.cpp index 8913b88d1a..4072dcebe5 100644 --- a/modules/visual_script/editor/visual_script_property_selector.cpp +++ b/modules/visual_script/editor/visual_script_property_selector.cpp @@ -46,7 +46,7 @@ void VisualScriptPropertySelector::_update_icons() { search_box->set_right_icon(results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_box->set_clear_button_enabled(true); - search_box->add_theme_icon_override(SNAME("right_icon"), results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); + search_box->add_theme_icon_override("right_icon", results_tree->get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); search_visual_script_nodes->set_icon(results_tree->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons"))); search_classes->set_icon(results_tree->get_theme_icon(SNAME("Object"), SNAME("EditorIcons"))); @@ -1114,14 +1114,14 @@ TreeItem *VisualScriptPropertySelector::SearchRunner::_create_class_item(TreeIte String details = p_doc->name; if (p_doc->category.begins_with("VisualScriptCustomNode/")) { Vector path = p_doc->name.split("/"); - icon = ui_service->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons")); + icon = ui_service->get_theme_icon("VisualScript", "EditorIcons"); text_0 = path[path.size() - 1]; text_1 = "VisualScriptCustomNode"; what = "VisualScriptCustomNode"; details = "CustomNode"; } else if (p_doc->category.begins_with("VisualScriptNode/")) { Vector path = p_doc->name.split("/"); - icon = ui_service->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons")); + icon = ui_service->get_theme_icon("VisualScript", "EditorIcons"); text_0 = path[path.size() - 1]; if (p_doc->category.begins_with("VisualScriptNode/deconstruct")) { text_0 = "deconstruct " + text_0; @@ -1142,11 +1142,11 @@ TreeItem *VisualScriptPropertySelector::SearchRunner::_create_class_item(TreeIte } else { if (p_doc->name.is_quoted()) { text_0 = p_doc->name.unquote().get_file(); - if (ui_service->has_theme_icon(p_doc->inherits, SNAME("EditorIcons"))) { - icon = ui_service->get_theme_icon(p_doc->inherits, SNAME("EditorIcons")); + if (ui_service->has_theme_icon(p_doc->inherits, "EditorIcons")) { + icon = ui_service->get_theme_icon(p_doc->inherits, "EditorIcons"); } - } else if (ui_service->has_theme_icon(p_doc->name, SNAME("EditorIcons"))) { - icon = ui_service->get_theme_icon(p_doc->name, SNAME("EditorIcons")); + } else if (ui_service->has_theme_icon(p_doc->name, "EditorIcons")) { + icon = ui_service->get_theme_icon(p_doc->name, "EditorIcons"); } else if (ClassDB::class_exists(p_doc->name) && ClassDB::is_parent_class(p_doc->name, "Object")) { icon = ui_service->get_theme_icon(SNAME("Object"), SNAME("EditorIcons")); } -- cgit v1.2.3