From 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 16:41:43 +0200 Subject: Style: Enforce braces around if blocks and loops Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html --- editor/editor_node.cpp | 396 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 258 insertions(+), 138 deletions(-) (limited to 'editor/editor_node.cpp') diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index c8f07f4b8d..ca0e486259 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -230,8 +230,9 @@ void EditorNode::_update_scene_tabs() { scene_tabs->add_child(scene_tab_add); } Rect2 last_tab = Rect2(); - if (scene_tabs->get_tab_count() != 0) + if (scene_tabs->get_tab_count() != 0) { last_tab = scene_tabs->get_tab_rect(scene_tabs->get_tab_count() - 1); + } scene_tab_add->set_position(Point2(last_tab.get_position().x + last_tab.get_size().x + 3, last_tab.get_position().y)); } } @@ -251,10 +252,12 @@ void EditorNode::_update_title() { String appname = ProjectSettings::get_singleton()->get("application/config/name"); String title = appname.empty() ? String(VERSION_FULL_NAME) : String(VERSION_NAME + String(" - ") + appname); String edited = editor_data.get_edited_scene_root() ? editor_data.get_edited_scene_root()->get_filename() : String(); - if (!edited.empty()) + if (!edited.empty()) { title += " - " + String(edited.get_file()); - if (unsaved_cache) + } + if (unsaved_cache) { title += " (*)"; + } DisplayServer::get_singleton()->window_set_title(title); } @@ -303,8 +306,9 @@ void EditorNode::_unhandled_input(const Ref &p_event) { void EditorNode::_notification(int p_what) { switch (p_what) { case NOTIFICATION_PROCESS: { - if (opening_prev && !confirmation->is_visible()) + if (opening_prev && !confirmation->is_visible()) { opening_prev = false; + } if (unsaved_cache != (saved_version != editor_data.get_undo_redo().get_version())) { unsaved_cache = (saved_version != editor_data.get_undo_redo().get_version()); @@ -322,8 +326,9 @@ void EditorNode::_notification(int p_what) { if (frame != update_spinner_step_frame && (tick - update_spinner_step_msec) > (1000 / 8)) { update_spinner_step++; - if (update_spinner_step >= 8) + if (update_spinner_step >= 8) { update_spinner_step = 0; + } update_spinner_step_msec = tick; update_spinner_step_frame = frame + 1; @@ -474,8 +479,9 @@ void EditorNode::_notification(int p_what) { recent_scenes->set_as_minsize(); // debugger area - if (EditorDebuggerNode::get_singleton()->is_visible()) + if (EditorDebuggerNode::get_singleton()->is_visible()) { bottom_panel->add_theme_style_override("panel", gui_base->get_theme_stylebox("BottomPanelDebuggerOverride", "EditorStyles")); + } // update_icons for (int i = 0; i < singleton->main_editor_buttons.size(); i++) { @@ -540,8 +546,9 @@ void EditorNode::_update_update_spinner() { void EditorNode::_on_plugin_ready(Object *p_script, const String &p_activate_name) { Ref