summaryrefslogtreecommitdiffstats
path: root/editor/localization_editor.cpp
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2023-09-09 17:24:40 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2023-09-15 20:15:39 +0200
commit75ee58fd0476360c67375cf403f06644a0aa117e (patch)
treedbfda27d4bcd56ed9dc6362c2e51521059e98788 /editor/localization_editor.cpp
parent5f1e56ff26be4070496aa51095b9ac2f2b4f4ed8 (diff)
downloadredot-engine-75ee58fd0476360c67375cf403f06644a0aa117e.tar.gz
[Editor] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
Diffstat (limited to 'editor/localization_editor.cpp')
-rw-r--r--editor/localization_editor.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp
index d4154d371b..fb34740318 100644
--- a/editor/localization_editor.cpp
+++ b/editor/localization_editor.cpp
@@ -101,7 +101,7 @@ void LocalizationEditor::_translation_delete(Object *p_item, int p_column, int p
}
TreeItem *ti = Object::cast_to<TreeItem>(p_item);
- ERR_FAIL_COND(!ti);
+ ERR_FAIL_NULL(ti);
int idx = ti->get_metadata(0);
@@ -163,7 +163,7 @@ void LocalizationEditor::_translation_res_option_add(const PackedStringArray &p_
Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps");
TreeItem *k = translation_remap->get_selected();
- ERR_FAIL_COND(!k);
+ ERR_FAIL_NULL(k);
String key = k->get_metadata(0);
@@ -194,7 +194,7 @@ void LocalizationEditor::_translation_res_select() {
void LocalizationEditor::_translation_res_option_popup(bool p_arrow_clicked) {
TreeItem *ed = translation_remap_options->get_edited();
- ERR_FAIL_COND(!ed);
+ ERR_FAIL_NULL(ed);
locale_select->set_locale(ed->get_tooltip_text(1));
locale_select->popup_locale_dialog();
@@ -202,7 +202,7 @@ void LocalizationEditor::_translation_res_option_popup(bool p_arrow_clicked) {
void LocalizationEditor::_translation_res_option_selected(const String &p_locale) {
TreeItem *ed = translation_remap_options->get_edited();
- ERR_FAIL_COND(!ed);
+ ERR_FAIL_NULL(ed);
ed->set_text(1, TranslationServer::get_singleton()->get_locale_name(p_locale));
ed->set_tooltip_text(1, p_locale);
@@ -222,9 +222,9 @@ void LocalizationEditor::_translation_res_option_changed() {
Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps");
TreeItem *k = translation_remap->get_selected();
- ERR_FAIL_COND(!k);
+ ERR_FAIL_NULL(k);
TreeItem *ed = translation_remap_options->get_edited();
- ERR_FAIL_COND(!ed);
+ ERR_FAIL_NULL(ed);
String key = k->get_metadata(0);
int idx = ed->get_metadata(0);
@@ -299,9 +299,9 @@ void LocalizationEditor::_translation_res_option_delete(Object *p_item, int p_co
Dictionary remaps = GLOBAL_GET("internationalization/locale/translation_remaps");
TreeItem *k = translation_remap->get_selected();
- ERR_FAIL_COND(!k);
+ ERR_FAIL_NULL(k);
TreeItem *ed = Object::cast_to<TreeItem>(p_item);
- ERR_FAIL_COND(!ed);
+ ERR_FAIL_NULL(ed);
String key = k->get_metadata(0);
int idx = ed->get_metadata(0);
@@ -348,7 +348,7 @@ void LocalizationEditor::_pot_delete(Object *p_item, int p_column, int p_button,
}
TreeItem *ti = Object::cast_to<TreeItem>(p_item);
- ERR_FAIL_COND(!ti);
+ ERR_FAIL_NULL(ti);
int idx = ti->get_metadata(0);