diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-24 14:21:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-24 14:21:06 +0200 |
commit | 96d7bc62af25b85b8b9cc091eeea1e7a784ba624 (patch) | |
tree | 83d8a70c911fe7f8d20080a1395d195eb8370d05 /editor/script_create_dialog.cpp | |
parent | 9ac27b58c53b50b5c7085a8fdee653e9eff159d1 (diff) | |
parent | 4e6efd1b07f1c6d53d226977ddc729333b74306a (diff) |
Merge pull request #50511 from aaronfranke/iterators
Use C++ range iterators for Lists in many situations
Diffstat (limited to 'editor/script_create_dialog.cpp')
-rw-r--r-- | editor/script_create_dialog.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 2601382009..90481b2107 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -205,12 +205,12 @@ String ScriptCreateDialog::_validate_path(const String &p_path, bool p_file_must bool found = false; bool match = false; int index = 0; - for (List<String>::Element *E = extensions.front(); E; E = E->next()) { - if (E->get().nocasecmp_to(extension) == 0) { + for (String &E : extensions) { + if (E.nocasecmp_to(extension) == 0) { //FIXME (?) - changing language this way doesn't update controls, needs rework //language_menu->select(index); // change Language option by extension found = true; - if (E->get() == ScriptServer::get_language(language_menu->get_selected())->get_extension()) { + if (E == ScriptServer::get_language(language_menu->get_selected())->get_extension()) { match = true; } break; @@ -373,8 +373,8 @@ void ScriptCreateDialog::_lang_changed(int l) { ScriptServer::get_language(m)->get_recognized_extensions(&extensions); } - for (List<String>::Element *E = extensions.front(); E; E = E->next()) { - if (E->get().nocasecmp_to(extension) == 0) { + for (String &E : extensions) { + if (E.nocasecmp_to(extension) == 0) { path = path.get_basename() + selected_ext; _path_changed(path); break; @@ -534,8 +534,8 @@ void ScriptCreateDialog::_browse_path(bool browse_parent, bool p_save) { int lang = language_menu->get_selected(); ScriptServer::get_language(lang)->get_recognized_extensions(&extensions); - for (List<String>::Element *E = extensions.front(); E; E = E->next()) { - file_browse->add_filter("*." + E->get()); + for (String &E : extensions) { + file_browse->add_filter("*." + E); } file_browse->set_current_path(file_path->get_text()); |