summaryrefslogtreecommitdiff
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 9a0dd4e3bc..3db03c0276 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1508,7 +1508,7 @@ String EditorInspector::get_selected_path() const {
}
void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<EditorInspectorPlugin> ped) {
- for (EditorInspectorPlugin::AddedEditor &F : ped->added_editors) {
+ for (const EditorInspectorPlugin::AddedEditor &F : ped->added_editors) {
EditorProperty *ep = Object::cast_to<EditorProperty>(F.property_editor);
current_vbox->add_child(F.property_editor);
@@ -1648,7 +1648,7 @@ void EditorInspector::update_tree() {
Color sscolor = get_theme_color(SNAME("prop_subsection"), SNAME("Editor"));
- for (Ref<EditorInspectorPlugin> ped : valid_plugins) {
+ for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
ped->parse_begin(object);
_parse_added_editors(main_vbox, ped);
}
@@ -1745,7 +1745,7 @@ void EditorInspector::update_tree() {
category->set_tooltip(p.name + "::" + (class_descr_cache[type2] == "" ? "" : class_descr_cache[type2]));
}
- for (Ref<EditorInspectorPlugin> ped : valid_plugins) {
+ for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
ped->parse_category(object, p.name);
_parse_added_editors(main_vbox, ped);
}
@@ -1946,13 +1946,13 @@ void EditorInspector::update_tree() {
doc_hint = descr;
}
- for (Ref<EditorInspectorPlugin> ped : valid_plugins) {
+ for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
bool exclusive = ped->parse_property(object, p.type, p.name, p.hint, p.hint_string, p.usage, wide_editors);
List<EditorInspectorPlugin::AddedEditor> editors = ped->added_editors; //make a copy, since plugins may be used again in a sub-inspector
ped->added_editors.clear();
- for (EditorInspectorPlugin::AddedEditor &F : editors) {
+ for (const EditorInspectorPlugin::AddedEditor &F : editors) {
EditorProperty *ep = Object::cast_to<EditorProperty>(F.property_editor);
if (ep) {
@@ -1970,7 +1970,7 @@ void EditorInspector::update_tree() {
if (F.label != String()) {
ep->set_label(F.label);
} else {
- //use existin one
+ // Use the existing one.
ep->set_label(name);
}
for (int i = 0; i < F.properties.size(); i++) {
@@ -2028,7 +2028,7 @@ void EditorInspector::update_tree() {
}
}
- for (Ref<EditorInspectorPlugin> ped : valid_plugins) {
+ for (Ref<EditorInspectorPlugin> &ped : valid_plugins) {
ped->parse_end();
_parse_added_editors(main_vbox, ped);
}
@@ -2391,7 +2391,7 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) {
Variant to_create;
List<PropertyInfo> pinfo;
object->get_property_list(&pinfo);
- for (PropertyInfo &E : pinfo) {
+ for (const PropertyInfo &E : pinfo) {
if (E.name == p_path) {
Callable::CallError ce;
Variant::construct(E.type, to_create, nullptr, 0, ce);
@@ -2595,7 +2595,7 @@ void EditorInspector::_update_script_class_properties(const Object &p_object, Li
}
Set<StringName> added;
- for (Ref<Script> s : classes) {
+ for (const Ref<Script> &s : classes) {
String path = s->get_path();
String name = EditorNode::get_editor_data().script_class_get_name(path);
if (name.is_empty()) {