mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Rename empty() to is_empty()
This commit is contained in:
parent
886571e0fc
commit
5b937d493f
289 changed files with 898 additions and 898 deletions
|
@ -377,9 +377,9 @@ void EditorNode::_version_control_menu_option(int p_idx) {
|
|||
|
||||
void EditorNode::_update_title() {
|
||||
String appname = ProjectSettings::get_singleton()->get("application/config/name");
|
||||
String title = appname.empty() ? String(VERSION_FULL_NAME) : String(VERSION_NAME + String(" - ") + appname);
|
||||
String title = appname.is_empty() ? String(VERSION_FULL_NAME) : String(VERSION_NAME + String(" - ") + appname);
|
||||
String edited = editor_data.get_edited_scene_root() ? editor_data.get_edited_scene_root()->get_filename() : String();
|
||||
if (!edited.empty()) {
|
||||
if (!edited.is_empty()) {
|
||||
title += " - " + String(edited.get_file());
|
||||
}
|
||||
if (unsaved_cache) {
|
||||
|
@ -782,8 +782,8 @@ void EditorNode::_fs_changed() {
|
|||
preset_name);
|
||||
} else {
|
||||
Ref<EditorExportPlatform> platform = preset->get_platform();
|
||||
const String export_path = export_defer.path.empty() ? preset->get_export_path() : export_defer.path;
|
||||
if (export_path.empty()) {
|
||||
const String export_path = export_defer.path.is_empty() ? preset->get_export_path() : export_defer.path;
|
||||
if (export_path.is_empty()) {
|
||||
export_error = vformat("Export preset '%s' doesn't have a default export path, and none was specified.", preset_name);
|
||||
} else if (platform.is_null()) {
|
||||
export_error = vformat("Export preset '%s' doesn't have a matching platform.", preset_name);
|
||||
|
@ -821,7 +821,7 @@ void EditorNode::_fs_changed() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!export_error.empty()) {
|
||||
if (!export_error.is_empty()) {
|
||||
ERR_PRINT(export_error);
|
||||
OS::get_singleton()->set_exit_code(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -1711,7 +1711,7 @@ void EditorNode::_dialog_action(String p_file) {
|
|||
current_obj->_change_notify();
|
||||
} break;
|
||||
case SETTINGS_LAYOUT_SAVE: {
|
||||
if (p_file.empty()) {
|
||||
if (p_file.is_empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1739,7 +1739,7 @@ void EditorNode::_dialog_action(String p_file) {
|
|||
|
||||
} break;
|
||||
case SETTINGS_LAYOUT_DELETE: {
|
||||
if (p_file.empty()) {
|
||||
if (p_file.is_empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1822,7 +1822,7 @@ void EditorNode::edit_item(Object *p_object) {
|
|||
sub_plugins = editor_data.get_subeditors(p_object);
|
||||
}
|
||||
|
||||
if (!sub_plugins.empty()) {
|
||||
if (!sub_plugins.is_empty()) {
|
||||
bool same = true;
|
||||
if (sub_plugins.size() == editor_plugins_over->get_plugins_list().size()) {
|
||||
for (int i = 0; i < sub_plugins.size(); i++) {
|
||||
|
@ -1998,7 +1998,7 @@ void EditorNode::_edit_current() {
|
|||
multi_nodes.push_back(node);
|
||||
}
|
||||
}
|
||||
if (!multi_nodes.empty()) {
|
||||
if (!multi_nodes.is_empty()) {
|
||||
// Pick the top-most node
|
||||
multi_nodes.sort_custom<Node::Comparator>();
|
||||
selected_node = multi_nodes.front()->get();
|
||||
|
@ -2080,13 +2080,13 @@ void EditorNode::_edit_current() {
|
|||
sub_plugins = editor_data.get_subeditors(current_obj);
|
||||
}
|
||||
|
||||
if (!sub_plugins.empty()) {
|
||||
if (!sub_plugins.is_empty()) {
|
||||
_display_top_editors(false);
|
||||
|
||||
_set_top_editors(sub_plugins);
|
||||
_set_editing_top_editors(current_obj);
|
||||
_display_top_editors(true);
|
||||
} else if (!editor_plugins_over->get_plugins_list().empty()) {
|
||||
} else if (!editor_plugins_over->get_plugins_list().is_empty()) {
|
||||
hide_top_editors();
|
||||
}
|
||||
}
|
||||
|
@ -2256,7 +2256,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
|
||||
} break;
|
||||
case FILE_OPEN_PREV: {
|
||||
if (previous_scenes.empty()) {
|
||||
if (previous_scenes.is_empty()) {
|
||||
break;
|
||||
}
|
||||
opening_prev = true;
|
||||
|
@ -2527,7 +2527,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||
|
||||
} break;
|
||||
case RUN_PLAY_CUSTOM_SCENE: {
|
||||
if (run_custom_filename.empty() || editor_run.get_status() == EditorRun::STATUS_STOP) {
|
||||
if (run_custom_filename.is_empty() || editor_run.get_status() == EditorRun::STATUS_STOP) {
|
||||
_menu_option_confirm(RUN_STOP, true);
|
||||
quick_run->popup_dialog("PackedScene", true);
|
||||
quick_run->set_title(TTR("Quick Run Scene..."));
|
||||
|
@ -2876,7 +2876,7 @@ void EditorNode::_update_file_menu_opened() {
|
|||
Ref<Shortcut> reopen_closed_scene_sc = ED_GET_SHORTCUT("editor/reopen_closed_scene");
|
||||
reopen_closed_scene_sc->set_name(TTR("Reopen Closed Scene"));
|
||||
PopupMenu *pop = file_menu->get_popup();
|
||||
pop->set_item_disabled(pop->get_item_index(FILE_OPEN_PREV), previous_scenes.empty());
|
||||
pop->set_item_disabled(pop->get_item_index(FILE_OPEN_PREV), previous_scenes.is_empty());
|
||||
}
|
||||
|
||||
void EditorNode::_update_file_menu_closed() {
|
||||
|
@ -3823,7 +3823,7 @@ Ref<Texture2D> EditorNode::get_object_icon(const Object *p_object, const String
|
|||
}
|
||||
|
||||
Ref<Texture2D> EditorNode::get_class_icon(const String &p_class, const String &p_fallback) const {
|
||||
ERR_FAIL_COND_V_MSG(p_class.empty(), nullptr, "Class name cannot be empty.");
|
||||
ERR_FAIL_COND_V_MSG(p_class.is_empty(), nullptr, "Class name cannot be empty.");
|
||||
|
||||
if (ScriptServer::is_global_class(p_class)) {
|
||||
Ref<ImageTexture> icon;
|
||||
|
@ -4555,7 +4555,7 @@ bool EditorNode::has_scenes_in_session() {
|
|||
return false;
|
||||
}
|
||||
Array scenes = config->get_value("EditorNode", "open_scenes");
|
||||
return !scenes.empty();
|
||||
return !scenes.is_empty();
|
||||
}
|
||||
|
||||
bool EditorNode::ensure_main_scene(bool p_from_native) {
|
||||
|
@ -4781,7 +4781,7 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) {
|
|||
Ref<Shortcut> undo_close_tab_sc = ED_GET_SHORTCUT("editor/reopen_closed_scene");
|
||||
undo_close_tab_sc->set_name(TTR("Undo Close Tab"));
|
||||
scene_tabs_context_menu->add_shortcut(undo_close_tab_sc, FILE_OPEN_PREV);
|
||||
if (previous_scenes.empty()) {
|
||||
if (previous_scenes.is_empty()) {
|
||||
scene_tabs_context_menu->set_item_disabled(scene_tabs_context_menu->get_item_index(FILE_OPEN_PREV), true);
|
||||
}
|
||||
scene_tabs_context_menu->add_item(TTR("Close Other Tabs"), FILE_CLOSE_OTHERS);
|
||||
|
@ -5185,7 +5185,7 @@ void EditorNode::_add_dropped_files_recursive(const Vector<String> &p_files, Str
|
|||
next_file = sub_dir->get_next();
|
||||
}
|
||||
|
||||
if (!sub_files.empty()) {
|
||||
if (!sub_files.is_empty()) {
|
||||
dir->make_dir(to);
|
||||
_add_dropped_files_recursive(sub_files, to);
|
||||
}
|
||||
|
@ -6950,8 +6950,8 @@ void EditorPluginList::remove_plugin(EditorPlugin *p_plugin) {
|
|||
plugins_list.erase(p_plugin);
|
||||
}
|
||||
|
||||
bool EditorPluginList::empty() {
|
||||
return plugins_list.empty();
|
||||
bool EditorPluginList::is_empty() {
|
||||
return plugins_list.is_empty();
|
||||
}
|
||||
|
||||
void EditorPluginList::clear() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue