diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_inspector.cpp | 10 | ||||
-rw-r--r-- | editor/editor_node.cpp | 29 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 4 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_obj.cpp | 2 | ||||
-rw-r--r-- | editor/import_defaults_editor.cpp | 4 | ||||
-rw-r--r-- | editor/import_dock.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/theme_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/settings_config_dialog.cpp | 2 |
10 files changed, 20 insertions, 41 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index cdbe505441..3db03c0276 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -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,7 +1946,7 @@ 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 @@ -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); } @@ -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()) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 267854d7ec..46d76a946f 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -797,8 +797,8 @@ void EditorNode::_resources_changed(const Vector<String> &p_resources) { } if (changed.size()) { - for (Ref<Resource> E : changed) { - E->reload_from_file(); + for (Ref<Resource> &res : changed) { + res->reload_from_file(); } } } @@ -1551,7 +1551,7 @@ int EditorNode::_save_external_resources() { int saved = 0; List<Ref<Resource>> cached; ResourceCache::get_cached_resources(&cached); - for (Ref<Resource> res : cached) { + for (const Ref<Resource> &res : cached) { if (!res->get_path().is_resource_file()) { continue; } @@ -1641,7 +1641,7 @@ void EditorNode::_save_scene(String p_file, int idx) { editor_data.save_editor_external_data(); - for (Ref<AnimatedValuesBackup> E : anim_backups) { + for (Ref<AnimatedValuesBackup> &E : anim_backups) { E->restore(); } @@ -5333,27 +5333,6 @@ void EditorNode::_file_access_close_error_notify(const String &p_str) { } void EditorNode::reload_scene(const String &p_path) { - /* - * No longer necessary since scenes now reset and reload their internal resource if needed. - //first of all, reload internal textures, materials, meshes, etc. as they might have changed on disk - - List<Ref<Resource>> cached; - ResourceCache::get_cached_resources(&cached); - List<Ref<Resource>> to_clear; //clear internal resources from previous scene from being used - for (Ref<Resource> E : cached) { - if (E->get_path().begins_with(p_path + "::")) { //subresources of existing scene - to_clear.push_back(E); - } - } - - //so reload reloads everything, clear subresources of previous scene - while (to_clear.front()) { - to_clear.front()->get()->set_path(""); - to_clear.pop_front(); - } - - */ - int scene_idx = -1; for (int i = 0; i < editor_data.get_edited_scene_count(); i++) { if (editor_data.get_scene_path(i) == p_path) { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index a52b14643e..df4469b6fe 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1580,7 +1580,7 @@ void EditorSettings::set_builtin_action_override(const String &p_name, const Arr int event_idx = 0; // Check equality of each event. - for (Ref<InputEvent> E : builtin_events) { + for (const Ref<InputEvent> &E : builtin_events) { if (!E->is_match(p_events[event_idx])) { same_as_builtin = false; break; @@ -1610,7 +1610,7 @@ const Array EditorSettings::get_builtin_action_overrides(const String &p_name) c Array event_array; List<Ref<InputEvent>> events_list = AO->get(); - for (Ref<InputEvent> E : events_list) { + for (const Ref<InputEvent> &E : events_list) { event_array.push_back(E); } return event_array; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index dbbbb03864..daee61c2dd 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1237,7 +1237,7 @@ void FileSystemDock::_update_resource_paths_after_move(const Map<String, String> List<Ref<Resource>> cached; ResourceCache::get_cached_resources(&cached); - for (Ref<Resource> r : cached) { + for (Ref<Resource> &r : cached) { String base_path = r->get_path(); String extra_path; int sep_pos = r->get_path().find("::"); diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 8b6bd8066f..34bc0a7d8d 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -438,7 +438,7 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in Node3D *scene = memnew(Node3D); - for (Ref<Mesh> m : meshes) { + for (const Ref<Mesh> &m : meshes) { Ref<EditorSceneImporterMesh> mesh; mesh.instantiate(); for (int i = 0; i < m->get_surface_count(); i++) { diff --git a/editor/import_defaults_editor.cpp b/editor/import_defaults_editor.cpp index 7c06ef4516..25bca1d4f4 100644 --- a/editor/import_defaults_editor.cpp +++ b/editor/import_defaults_editor.cpp @@ -106,7 +106,7 @@ void ImportDefaultsEditor::_update_importer() { List<Ref<ResourceImporter>> importer_list; ResourceFormatImporter::get_singleton()->get_importers(&importer_list); Ref<ResourceImporter> importer; - for (Ref<ResourceImporter> E : importer_list) { + for (const Ref<ResourceImporter> &E : importer_list) { if (E->get_visible_name() == importers->get_item_text(importers->get_selected())) { importer = E; break; @@ -166,7 +166,7 @@ void ImportDefaultsEditor::clear() { List<Ref<ResourceImporter>> importer_list; ResourceFormatImporter::get_singleton()->get_importers(&importer_list); Vector<String> names; - for (Ref<ResourceImporter> E : importer_list) { + for (const Ref<ResourceImporter> &E : importer_list) { String vn = E->get_visible_name(); names.push_back(vn); } diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 1f8fefbe6e..648e60a554 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -111,7 +111,7 @@ void ImportDock::set_edit_path(const String &p_path) { ResourceFormatImporter::get_singleton()->get_importers_for_extension(p_path.get_extension(), &importers); List<Pair<String, String>> importer_names; - for (Ref<ResourceImporter> E : importers) { + for (const Ref<ResourceImporter> &E : importers) { importer_names.push_back(Pair<String, String>(E->get_visible_name(), E->get_importer_name())); } @@ -254,7 +254,7 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) { ResourceFormatImporter::get_singleton()->get_importers_for_extension(p_paths[0].get_extension(), &importers); List<Pair<String, String>> importer_names; - for (Ref<ResourceImporter> E : importers) { + for (const Ref<ResourceImporter> &E : importers) { importer_names.push_back(Pair<String, String>(E->get_visible_name(), E->get_importer_name())); } diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index a5d0ebbc12..42f7d23da2 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -365,7 +365,7 @@ void SpriteFramesEditor::_file_load_request(const Vector<String> &p_path, int p_ int count = 0; - for (Ref<Texture2D> &E : resources) { + for (const Ref<Texture2D> &E : resources) { undo_redo->add_do_method(frames, "add_frame", edited_anim, E, p_at_pos == -1 ? -1 : p_at_pos + count); undo_redo->add_undo_method(frames, "remove_frame", edited_anim, p_at_pos == -1 ? fc : p_at_pos); count++; diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 6bd901cead..6bcc65e30c 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -2906,7 +2906,7 @@ void ThemeTypeEditor::_update_stylebox_from_leading() { continue; } - for (Ref<StyleBox> F : styleboxes) { + for (const Ref<StyleBox> &F : styleboxes) { Ref<StyleBox> sb = F; sb->set(E.name, value); } diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index aefa8e434e..b3ec0c96c4 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -403,7 +403,7 @@ void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column List<Ref<InputEvent>> defaults = InputMap::get_singleton()->get_builtins()[current_action]; // Convert the list to an array, and only keep key events as this is for the editor. - for (Ref<InputEvent> k : defaults) { + for (const Ref<InputEvent> &k : defaults) { if (k.is_valid()) { events.append(k); } |