diff options
Diffstat (limited to 'modules/gdnative')
5 files changed, 10 insertions, 11 deletions
diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index 9dad13a615..df3c37f730 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -110,7 +110,7 @@ void GDNativeLibraryEditor::_update_tree() { TreeItem *new_arch = tree->create_item(platform); new_arch->set_text(0, TTR("Double click to create a new entry")); - new_arch->set_text_align(0, TreeItem::ALIGN_CENTER); + new_arch->set_text_alignment(0, HORIZONTAL_ALIGNMENT_CENTER); new_arch->set_custom_color(0, get_theme_color(SNAME("accent_color"), SNAME("Editor"))); new_arch->set_expand_right(0, true); new_arch->set_metadata(1, E->key()); @@ -335,7 +335,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { hbox->add_child(label); filter = memnew(MenuButton); filter->set_h_size_flags(SIZE_EXPAND_FILL); - filter->set_text_align(filter->ALIGN_LEFT); + filter->set_text_alignment(HORIZONTAL_ALIGNMENT_LEFT); hbox->add_child(filter); PopupMenu *filter_list = filter->get_popup(); filter_list->set_hide_on_checkable_item_selection(false); diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index 598f7c7ad0..ae16c22849 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -397,7 +397,7 @@ List<ClassAPI> generate_c_api_classes() { arg_type = "Variant"; } else if (arg_info.type == Variant::OBJECT) { arg_type = arg_info.class_name; - if (arg_type == "") { + if (arg_type.is_empty()) { arg_type = Variant::get_type_name(arg_info.type); } } else { diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 368eb67fa6..075977b60f 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -682,7 +682,7 @@ void NativeScriptInstance::get_property_list(List<PropertyInfo> *p_properties) c ERR_CONTINUE(info.type < 0 || info.type >= Variant::VARIANT_MAX); info.name = d["name"]; - ERR_CONTINUE(info.name == ""); + ERR_CONTINUE(info.name.is_empty()); if (d.has("hint")) { info.hint = PropertyHint(d["hint"].operator int64_t()); diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index 04a293ddbd..5bda9e1d53 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -232,8 +232,7 @@ bool PluginScript::instance_has(const Object *p_this) const { } bool PluginScript::has_source_code() const { - bool has = _source != ""; - return has; + return !_source.is_empty(); } String PluginScript::get_source_code() const { @@ -257,11 +256,11 @@ Error PluginScript::reload(bool p_keep_state) { _valid = false; String basedir = _path; - if (basedir == "") { + if (basedir.is_empty()) { basedir = get_path(); } - if (basedir != "") { + if (!basedir.is_empty()) { basedir = basedir.get_base_dir(); } diff --git a/modules/gdnative/pluginscript/register_types.cpp b/modules/gdnative/pluginscript/register_types.cpp index 7faacfdcb9..c4fbff69f0 100644 --- a/modules/gdnative/pluginscript/register_types.cpp +++ b/modules/gdnative/pluginscript/register_types.cpp @@ -44,9 +44,9 @@ static List<PluginScriptLanguage *> pluginscript_languages; static Error _check_language_desc(const godot_pluginscript_language_desc *desc) { - ERR_FAIL_COND_V(!desc->name || desc->name == String(), ERR_BUG); - ERR_FAIL_COND_V(!desc->type || desc->type == String(), ERR_BUG); - ERR_FAIL_COND_V(!desc->extension || desc->extension == String(), ERR_BUG); + ERR_FAIL_COND_V(!desc->name, ERR_BUG); + ERR_FAIL_COND_V(!desc->type, ERR_BUG); + ERR_FAIL_COND_V(!desc->extension, ERR_BUG); ERR_FAIL_COND_V(!desc->recognized_extensions || !desc->recognized_extensions[0], ERR_BUG); ERR_FAIL_COND_V(!desc->init, ERR_BUG); ERR_FAIL_COND_V(!desc->finish, ERR_BUG); |