summaryrefslogtreecommitdiff
path: root/editor/project_settings_editor.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-07-15 23:45:57 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-07-23 17:38:28 -0400
commit4e6efd1b07f1c6d53d226977ddc729333b74306a (patch)
treea52f672e7f622bb65e3b65f2a2edc9d19b1ecdcf /editor/project_settings_editor.cpp
parentb918c4c3ce84af1f8af2d06ef31784f48a15551a (diff)
Use C++ iterators for Lists in many situations
Diffstat (limited to 'editor/project_settings_editor.cpp')
-rw-r--r--editor/project_settings_editor.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 2c4b28e13d..bc44fccfa0 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -229,16 +229,16 @@ void ProjectSettingsEditor::_add_feature_overrides() {
for (int i = 0; i < ee->get_export_platform_count(); i++) {
List<String> p;
ee->get_export_platform(i)->get_platform_features(&p);
- for (List<String>::Element *E = p.front(); E; E = E->next()) {
- presets.insert(E->get());
+ for (String &E : p) {
+ presets.insert(E);
}
}
for (int i = 0; i < ee->get_export_preset_count(); i++) {
List<String> p;
ee->get_export_preset(i)->get_platform()->get_preset_features(ee->get_export_preset(i), &p);
- for (List<String>::Element *E = p.front(); E; E = E->next()) {
- presets.insert(E->get());
+ for (String &E : p) {
+ presets.insert(E);
}
String custom = ee->get_export_preset(i)->get_custom_features();
@@ -391,8 +391,7 @@ void ProjectSettingsEditor::_action_reordered(const String &p_action_name, const
undo_redo->create_action(TTR("Update Input Action Order"));
- for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
- PropertyInfo prop = E->get();
+ for (PropertyInfo &prop : props) {
// Skip builtins and non-inputs
if (ProjectSettings::get_singleton()->is_builtin_setting(prop.name) || !prop.name.begins_with("input/")) {
continue;
@@ -445,8 +444,8 @@ void ProjectSettingsEditor::_update_action_map_editor() {
ProjectSettings::get_singleton()->get_property_list(&props);
const Ref<Texture2D> builtin_icon = get_theme_icon(SNAME("PinPressed"), SNAME("EditorIcons"));
- for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
- const String property_name = E->get().name;
+ for (PropertyInfo &E : props) {
+ const String property_name = E.name;
if (!property_name.begins_with("input/")) {
continue;