From 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 13:23:58 +0200 Subject: Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027. --- editor/editor_properties.cpp | 141 ------------------------------------------- 1 file changed, 141 deletions(-) (limited to 'editor/editor_properties.cpp') diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index c5772e0ea7..9bb20122c6 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -112,7 +112,6 @@ void EditorPropertyMultilineText::_text_changed() { } void EditorPropertyMultilineText::_open_big_text() { - if (!big_text_dialog) { big_text = memnew(TextEdit); big_text->connect("text_changed", callable_mp(this, &EditorPropertyMultilineText::_big_text_changed)); @@ -172,9 +171,7 @@ EditorPropertyMultilineText::EditorPropertyMultilineText() { ///////////////////// TEXT ENUM ///////////////////////// void EditorPropertyTextEnum::_option_selected(int p_which) { - if (string_name) { - emit_changed(get_edited_property(), StringName(options->get_item_text(p_which))); } else { emit_changed(get_edited_property(), options->get_item_text(p_which)); @@ -182,7 +179,6 @@ void EditorPropertyTextEnum::_option_selected(int p_which) { } void EditorPropertyTextEnum::update_property() { - String which = get_edited_object()->get(get_edited_property()); for (int i = 0; i < options->get_item_count(); i++) { String t = options->get_item_text(i); @@ -216,12 +212,10 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() { ///////////////////// PATH ///////////////////////// void EditorPropertyPath::_path_selected(const String &p_path) { - emit_changed(get_edited_property(), p_path); update_property(); } void EditorPropertyPath::_path_pressed() { - if (!dialog) { dialog = memnew(EditorFileDialog); dialog->connect("file_selected", callable_mp(this, &EditorPropertyPath::_path_selected)); @@ -257,33 +251,28 @@ void EditorPropertyPath::_path_pressed() { } void EditorPropertyPath::update_property() { - String full_path = get_edited_object()->get(get_edited_property()); path->set_text(full_path); path->set_tooltip(full_path); } void EditorPropertyPath::setup(const Vector &p_extensions, bool p_folder, bool p_global) { - extensions = p_extensions; folder = p_folder; global = p_global; } void EditorPropertyPath::set_save_mode() { - save_mode = true; } void EditorPropertyPath::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { path_edit->set_icon(get_theme_icon("Folder", "EditorIcons")); } } void EditorPropertyPath::_path_focus_exited() { - _path_selected(path->get_text()); } @@ -313,7 +302,6 @@ EditorPropertyPath::EditorPropertyPath() { ///////////////////// CLASS NAME ///////////////////////// void EditorPropertyClassName::setup(const String &p_base_type, const String &p_selected_type) { - base_type = p_base_type; dialog->set_base_type(base_type); selected_type = p_selected_type; @@ -321,7 +309,6 @@ void EditorPropertyClassName::setup(const String &p_base_type, const String &p_s } void EditorPropertyClassName::update_property() { - String s = get_edited_object()->get(get_edited_property()); property->set_text(s); selected_type = s; @@ -356,13 +343,11 @@ EditorPropertyClassName::EditorPropertyClassName() { ///////////////////// MEMBER ///////////////////////// void EditorPropertyMember::_property_selected(const String &p_selected) { - emit_changed(get_edited_property(), p_selected); update_property(); } void EditorPropertyMember::_property_select() { - if (!selector) { selector = memnew(PropertySelector); selector->connect("selected", callable_mp(this, &EditorPropertyMember::_property_selected)); @@ -372,7 +357,6 @@ void EditorPropertyMember::_property_select() { String current = get_edited_object()->get(get_edited_property()); if (hint == MEMBER_METHOD_OF_VARIANT_TYPE) { - Variant::Type type = Variant::NIL; for (int i = 0; i < Variant::VARIANT_MAX; i++) { if (hint_text == Variant::get_type_name(Variant::Type(i))) { @@ -383,24 +367,20 @@ void EditorPropertyMember::_property_select() { selector->select_method_from_basic_type(type, current); } else if (hint == MEMBER_METHOD_OF_BASE_TYPE) { - selector->select_method_from_base_type(hint_text, current); } else if (hint == MEMBER_METHOD_OF_INSTANCE) { - Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int64())); if (instance) selector->select_method_from_instance(instance, current); } else if (hint == MEMBER_METHOD_OF_SCRIPT) { - Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int64())); if (Object::cast_to