summaryrefslogtreecommitdiff
path: root/editor/editor_resource_picker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_resource_picker.cpp')
-rw-r--r--editor/editor_resource_picker.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp
index 41d769ad1f..cb3000ee88 100644
--- a/editor/editor_resource_picker.cpp
+++ b/editor/editor_resource_picker.cpp
@@ -253,8 +253,8 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
}
file_dialog->clear_filters();
- for (RBSet<String>::Element *E = valid_extensions.front(); E; E = E->next()) {
- file_dialog->add_filter("*." + E->get() + " ; " + E->get().to_upper());
+ for (const String &E : valid_extensions) {
+ file_dialog->add_filter("*." + E + " ; " + E.to_upper());
}
file_dialog->popup_file_dialog();
@@ -417,8 +417,8 @@ void EditorResourcePicker::set_create_options(Object *p_menu_node) {
custom_resources = EditorNode::get_editor_data().get_custom_types()["Resource"];
}
- for (RBSet<String>::Element *E = allowed_types.front(); E; E = E->next()) {
- const String &t = E->get();
+ for (const String &E : allowed_types) {
+ const String &t = E;
bool is_custom_resource = false;
Ref<Texture2D> icon;
@@ -599,8 +599,8 @@ bool EditorResourcePicker::_is_drop_valid(const Dictionary &p_drag_data) const {
}
bool EditorResourcePicker::_is_type_valid(const String p_type_name, RBSet<String> p_allowed_types) const {
- for (RBSet<String>::Element *E = p_allowed_types.front(); E; E = E->next()) {
- String at = E->get().strip_edges();
+ for (const String &E : p_allowed_types) {
+ String at = E.strip_edges();
if (p_type_name == at || ClassDB::is_parent_class(p_type_name, at) || EditorNode::get_editor_data().script_class_is_parent(p_type_name, at)) {
return true;
}
@@ -651,8 +651,8 @@ void EditorResourcePicker::drop_data_fw(const Point2 &p_point, const Variant &p_
// If the accepted dropped resource is from the extended list, it requires conversion.
if (!_is_type_valid(dropped_resource->get_class(), allowed_types)) {
- for (RBSet<String>::Element *E = allowed_types.front(); E; E = E->next()) {
- String at = E->get().strip_edges();
+ for (const String &E : allowed_types) {
+ String at = E.strip_edges();
if (at == "BaseMaterial3D" && Ref<Texture2D>(dropped_resource).is_valid()) {
// Use existing resource if possible and only replace its data.