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.
This commit is contained in:
Rémi Verschelde 2020-05-14 13:23:58 +02:00
parent 710b34b702
commit 0be6d925dc
1552 changed files with 1 additions and 33876 deletions

View file

@ -35,22 +35,18 @@
#include "editor_scale.h"
void PropertySelector::_text_changed(const String &p_newtext) {
_update_search();
}
void PropertySelector::_sbox_input(const Ref<InputEvent> &p_ie) {
Ref<InputEventKey> k = p_ie;
if (k.is_valid()) {
switch (k->get_keycode()) {
case KEY_UP:
case KEY_DOWN:
case KEY_PAGEUP:
case KEY_PAGEDOWN: {
search_options->call("_gui_input", k);
search_box->accept_event();
@ -74,7 +70,6 @@ void PropertySelector::_sbox_input(const Ref<InputEvent> &p_ie) {
}
void PropertySelector::_update_search() {
if (properties)
set_title(TTR("Select Property"));
else if (virtuals_only)
@ -88,7 +83,6 @@ void PropertySelector::_update_search() {
TreeItem *root = search_options->create_item();
if (properties) {
List<PropertyInfo> props;
if (instance) {
@ -100,10 +94,8 @@ void PropertySelector::_update_search() {
v.get_property_list(&props);
} else {
Object *obj = ObjectDB::get_instance(script);
if (Object::cast_to<Script>(obj)) {
props.push_back(PropertyInfo(Variant::NIL, "Script Variables", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_CATEGORY));
Object::cast_to<Script>(obj)->get_script_property_list(&props);
}
@ -195,7 +187,6 @@ void PropertySelector::_update_search() {
memdelete(category); //old category was unused
}
} else {
List<MethodInfo> methods;
if (type != Variant::NIL) {
@ -204,10 +195,8 @@ void PropertySelector::_update_search() {
v = Variant::construct(type, nullptr, 0, ce);
v.get_method_list(&methods);
} else {
Object *obj = ObjectDB::get_instance(script);
if (Object::cast_to<Script>(obj)) {
methods.push_back(MethodInfo("*Script Methods"));
Object::cast_to<Script>(obj)->get_script_method_list(&methods);
}
@ -277,7 +266,6 @@ void PropertySelector::_update_search() {
desc += " " + mi.name + " ( ";
for (int i = 0; i < mi.arguments.size(); i++) {
if (i > 0)
desc += ", ";
@ -319,7 +307,6 @@ void PropertySelector::_update_search() {
}
void PropertySelector::_confirmed() {
TreeItem *ti = search_options->get_selected();
if (!ti)
return;
@ -328,7 +315,6 @@ void PropertySelector::_confirmed() {
}
void PropertySelector::_item_selected() {
help_bit->set_text("");
TreeItem *item = search_options->get_selected();
@ -348,11 +334,9 @@ void PropertySelector::_item_selected() {
String text;
if (properties) {
String at_class = class_type;
while (at_class != String()) {
Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(at_class);
if (E) {
for (int i = 0; i < E->get().properties.size(); i++) {
@ -365,11 +349,9 @@ void PropertySelector::_item_selected() {
at_class = ClassDB::get_parent_class(at_class);
}
} else {
String at_class = class_type;
while (at_class != String()) {
Map<String, DocData::ClassDoc>::Element *E = dd->class_list.find(at_class);
if (E) {
for (int i = 0; i < E->get().methods.size(); i++) {
@ -394,9 +376,7 @@ void PropertySelector::_hide_requested() {
}
void PropertySelector::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
connect("confirmed", callable_mp(this, &PropertySelector::_confirmed));
} else if (p_what == NOTIFICATION_EXIT_TREE) {
disconnect("confirmed", callable_mp(this, &PropertySelector::_confirmed));
@ -404,7 +384,6 @@ void PropertySelector::_notification(int p_what) {
}
void PropertySelector::select_method_from_base_type(const String &p_base, const String &p_current, bool p_virtuals_only) {
base_type = p_base;
selected = p_current;
type = Variant::NIL;
@ -420,7 +399,6 @@ void PropertySelector::select_method_from_base_type(const String &p_base, const
}
void PropertySelector::select_method_from_script(const Ref<Script> &p_script, const String &p_current) {
ERR_FAIL_COND(p_script.is_null());
base_type = p_script->get_instance_base_type();
selected = p_current;
@ -436,7 +414,6 @@ void PropertySelector::select_method_from_script(const Ref<Script> &p_script, co
_update_search();
}
void PropertySelector::select_method_from_basic_type(Variant::Type p_type, const String &p_current) {
ERR_FAIL_COND(p_type == Variant::NIL);
base_type = "";
selected = p_current;
@ -453,7 +430,6 @@ void PropertySelector::select_method_from_basic_type(Variant::Type p_type, const
}
void PropertySelector::select_method_from_instance(Object *p_instance, const String &p_current) {
base_type = p_instance->get_class();
selected = p_current;
type = Variant::NIL;
@ -474,7 +450,6 @@ void PropertySelector::select_method_from_instance(Object *p_instance, const Str
}
void PropertySelector::select_property_from_base_type(const String &p_base, const String &p_current) {
base_type = p_base;
selected = p_current;
type = Variant::NIL;
@ -490,7 +465,6 @@ void PropertySelector::select_property_from_base_type(const String &p_base, cons
}
void PropertySelector::select_property_from_script(const Ref<Script> &p_script, const String &p_current) {
ERR_FAIL_COND(p_script.is_null());
base_type = p_script->get_instance_base_type();
@ -508,7 +482,6 @@ void PropertySelector::select_property_from_script(const Ref<Script> &p_script,
}
void PropertySelector::select_property_from_basic_type(Variant::Type p_type, const String &p_current) {
ERR_FAIL_COND(p_type == Variant::NIL);
base_type = "";
selected = p_current;
@ -525,7 +498,6 @@ void PropertySelector::select_property_from_basic_type(Variant::Type p_type, con
}
void PropertySelector::select_property_from_instance(Object *p_instance, const String &p_current) {
base_type = "";
selected = p_current;
type = Variant::NIL;
@ -545,12 +517,10 @@ void PropertySelector::set_type_filter(const Vector<Variant::Type> &p_type_filte
}
void PropertySelector::_bind_methods() {
ADD_SIGNAL(MethodInfo("selected", PropertyInfo(Variant::STRING, "name")));
}
PropertySelector::PropertySelector() {
VBoxContainer *vbc = memnew(VBoxContainer);
add_child(vbc);
//set_child_rect(vbc);