From 1ce81dc5f2bd5db8bff0e60af846b994492810f9 Mon Sep 17 00:00:00 2001 From: jmb462 Date: Sun, 6 Feb 2022 15:53:53 +0100 Subject: Add missing SNAME macro optimization in some function calls --- editor/animation_track_editor.cpp | 14 +- editor/code_editor.cpp | 4 +- editor/connections_dialog.cpp | 4 +- editor/debugger/editor_debugger_node.cpp | 2 +- editor/debugger/script_editor_debugger.cpp | 6 +- editor/editor_export.cpp | 4 +- editor/editor_help.cpp | 26 +-- editor/editor_help_search.cpp | 4 +- editor/editor_inspector.cpp | 26 +-- editor/editor_node.cpp | 36 +-- editor/editor_themes.cpp | 250 ++++++++++----------- editor/plugins/node_3d_editor_gizmos.cpp | 2 +- editor/plugins/script_text_editor.cpp | 8 +- editor/plugins/skeleton_3d_editor_plugin.cpp | 2 +- editor/plugins/tiles/tile_data_editors.cpp | 2 +- .../plugins/tiles/tile_set_atlas_source_editor.cpp | 2 +- editor/project_manager.cpp | 2 +- editor/scene_tree_editor.cpp | 4 +- editor/script_create_dialog.cpp | 4 +- platform/javascript/export/export_plugin.cpp | 2 +- platform/javascript/export/export_plugin.h | 2 +- scene/3d/xr_nodes.cpp | 8 +- scene/gui/tab_container.cpp | 2 +- scene/gui/tree.cpp | 6 +- scene/resources/texture.cpp | 2 +- scene/resources/tile_set.cpp | 2 +- servers/xr/xr_positional_tracker.cpp | 10 +- 27 files changed, 218 insertions(+), 218 deletions(-) diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index e36d0b846b..2f33619a52 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1723,15 +1723,15 @@ void AnimationTimelineEdit::update_values() { switch (animation->get_loop_mode()) { case Animation::LoopMode::LOOP_NONE: { - loop->set_icon(get_theme_icon("Loop", "EditorIcons")); + loop->set_icon(get_theme_icon(SNAME("Loop"), SNAME("EditorIcons"))); loop->set_pressed(false); } break; case Animation::LoopMode::LOOP_LINEAR: { - loop->set_icon(get_theme_icon("Loop", "EditorIcons")); + loop->set_icon(get_theme_icon(SNAME("Loop"), SNAME("EditorIcons"))); loop->set_pressed(true); } break; case Animation::LoopMode::LOOP_PINGPONG: { - loop->set_icon(get_theme_icon("PingPongLoop", "EditorIcons")); + loop->set_icon(get_theme_icon(SNAME("PingPongLoop"), SNAME("EditorIcons"))); loop->set_pressed(true); } break; default: @@ -4516,7 +4516,7 @@ void AnimationTrackEditor::_notification(int p_what) { if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) { zoom_icon->set_texture(get_theme_icon(SNAME("Zoom"), SNAME("EditorIcons"))); snap->set_icon(get_theme_icon(SNAME("Snap"), SNAME("EditorIcons"))); - view_group->set_icon(get_theme_icon(view_group->is_pressed() ? "AnimationTrackList" : "AnimationTrackGroup", "EditorIcons")); + view_group->set_icon(get_theme_icon(view_group->is_pressed() ? SNAME("AnimationTrackList") : SNAME("AnimationTrackGroup"), SNAME("EditorIcons"))); selected_filter->set_icon(get_theme_icon(SNAME("AnimationFilter"), SNAME("EditorIcons"))); imported_anim_warning->set_icon(get_theme_icon(SNAME("NodeWarning"), SNAME("EditorIcons"))); main_panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree"))); @@ -5493,8 +5493,8 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { String text; Ref icon = get_theme_icon(SNAME("Node"), SNAME("EditorIcons")); if (node) { - if (has_theme_icon(node->get_class(), "EditorIcons")) { - icon = get_theme_icon(node->get_class(), "EditorIcons"); + if (has_theme_icon(node->get_class(), SNAME("EditorIcons"))) { + icon = get_theme_icon(node->get_class(), SNAME("EditorIcons")); } text = node->get_name(); @@ -5907,7 +5907,7 @@ void AnimationTrackEditor::_cleanup_animation(Ref p_animation) { void AnimationTrackEditor::_view_group_toggle() { _update_tracks(); - view_group->set_icon(get_theme_icon(view_group->is_pressed() ? "AnimationTrackList" : "AnimationTrackGroup", "EditorIcons")); + view_group->set_icon(get_theme_icon(view_group->is_pressed() ? SNAME("AnimationTrackList") : SNAME("AnimationTrackGroup"), SNAME("EditorIcons"))); } bool AnimationTrackEditor::is_grouping_tracks() { diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 967f7e0d1f..2627baaea8 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -884,8 +884,8 @@ Ref CodeTextEditor::_get_completion_icon(const ScriptCodeCompletionOp Ref tex; switch (p_option.kind) { case ScriptCodeCompletionOption::KIND_CLASS: { - if (has_theme_icon(p_option.display, "EditorIcons")) { - tex = get_theme_icon(p_option.display, "EditorIcons"); + if (has_theme_icon(p_option.display, SNAME("EditorIcons"))) { + tex = get_theme_icon(p_option.display, SNAME("EditorIcons")); } else { tex = get_theme_icon(SNAME("Object"), SNAME("EditorIcons")); } diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 7c54558cd0..8efcd60210 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -988,8 +988,8 @@ void ConnectionsDock::update_tree() { name = scr->get_class(); } - if (has_theme_icon(scr->get_class(), "EditorIcons")) { - icon = get_theme_icon(scr->get_class(), "EditorIcons"); + if (has_theme_icon(scr->get_class(), SNAME("EditorIcons"))) { + icon = get_theme_icon(scr->get_class(), SNAME("EditorIcons")); } } } else { diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 79853b6809..4b6a11f388 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -500,7 +500,7 @@ void EditorDebuggerNode::set_breakpoint(const String &p_path, int p_line, bool p dbg->set_breakpoint(p_path, p_line, p_enabled); }); - emit_signal("breakpoint_toggled", p_path, p_line, p_enabled); + emit_signal(SNAME("breakpoint_toggled"), p_path, p_line, p_enabled); } void EditorDebuggerNode::set_breakpoints(const String &p_path, Array p_lines) { diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index ee844fff64..6aedfa6ccb 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -497,7 +497,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da TreeItem *error = error_tree->create_item(r); error->set_collapsed(true); - error->set_icon(0, get_theme_icon(oe.warning ? "Warning" : "Error", "EditorIcons")); + error->set_icon(0, get_theme_icon(oe.warning ? SNAME("Warning") : SNAME("Error"), SNAME("EditorIcons"))); error->set_text(0, time); error->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); @@ -888,12 +888,12 @@ void ScriptEditorDebugger::_clear_execution() { void ScriptEditorDebugger::_set_breakpoint(const String &p_file, const int &p_line, const bool &p_enabled) { Ref