diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2021-12-10 08:56:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-10 08:56:31 +0100 |
| commit | bdf8340e5993ec3f86e4bf1d5ede48df7d023a12 (patch) | |
| tree | 1e366583662397e366d4f84bb334660db37cb5bd /editor/editor_settings.cpp | |
| parent | 5ad9d8bad69309d71ea55f3d799af7e3711dc262 (diff) | |
| parent | 49403cbfa0399bb4284ea5c36cc90216a0bda6ff (diff) | |
| download | redot-engine-bdf8340e5993ec3f86e4bf1d5ede48df7d023a12.tar.gz | |
Merge pull request #43181 from nathanfranke/string-empty
Replace String comparisons with "", String() to is_empty()
Diffstat (limited to 'editor/editor_settings.cpp')
| -rw-r--r-- | editor/editor_settings.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 613e0ba7a0..95248b22b5 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -389,14 +389,14 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { best = locale; } - if (best == String() && host_lang.begins_with(locale)) { + if (best.is_empty() && host_lang.begins_with(locale)) { best = locale; } etl++; } - if (best == String()) { + if (best.is_empty()) { best = "en"; } @@ -989,7 +989,7 @@ void EditorSettings::setup_network() { if (ip == current) { selected = ip; } - if (hint != "") { + if (!hint.is_empty()) { hint += ","; } hint += ip; @@ -1008,7 +1008,7 @@ void EditorSettings::save() { return; } - if (singleton->config_file_path == "") { + if (singleton->config_file_path.is_empty()) { ERR_PRINT("Cannot save EditorSettings config, no valid path"); return; } @@ -1218,7 +1218,7 @@ void EditorSettings::load_favorites() { FileAccess *f = FileAccess::open(get_project_settings_dir().plus_file("favorites"), FileAccess::READ); if (f) { String line = f->get_line().strip_edges(); - while (line != "") { + while (!line.is_empty()) { favorites.push_back(line); line = f->get_line().strip_edges(); } @@ -1228,7 +1228,7 @@ void EditorSettings::load_favorites() { f = FileAccess::open(get_project_settings_dir().plus_file("recent_dirs"), FileAccess::READ); if (f) { String line = f->get_line().strip_edges(); - while (line != "") { + while (!line.is_empty()) { recent_dirs.push_back(line); line = f->get_line().strip_edges(); } @@ -1252,7 +1252,7 @@ void EditorSettings::list_text_editor_themes() { List<String> custom_themes; d->list_dir_begin(); String file = d->get_next(); - while (file != String()) { + while (!file.is_empty()) { if (file.get_extension() == "tet" && !_is_default_text_editor_theme(file.get_basename().to_lower())) { custom_themes.push_back(file.get_basename()); } @@ -1371,7 +1371,7 @@ Vector<String> EditorSettings::get_script_templates(const String &p_extension, c if (d) { d->list_dir_begin(); String file = d->get_next(); - while (file != String()) { + while (!file.is_empty()) { if (file.get_extension() == p_extension) { templates.push_back(file.get_basename()); } |
