summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2020-12-28 13:23:25 +0100
committerGitHub <noreply@github.com>2020-12-28 13:23:25 +0100
commitbe509bf5e4d00b33f2867e6d06a23285b2a8fd29 (patch)
tree975e0a7384bc6fc7cf5b73b9ddc1e8eef13579d8 /platform
parent886571e0fc54914f161ab3f1ccf9bfe40411bc20 (diff)
parent5b937d493f0046543a77a0be7920ad39f1e5fc3c (diff)
Merge pull request #44401 from madmiraal/rename-empty-is_empty
Rename empty() to is_empty()
Diffstat (limited to 'platform')
-rw-r--r--platform/android/export/export.cpp42
-rw-r--r--platform/android/export/gradle_export_util.h2
-rw-r--r--platform/android/plugin/godot_plugin_config.h18
-rw-r--r--platform/iphone/export/export.cpp12
-rw-r--r--platform/iphone/plugin/godot_plugin_config.h18
-rw-r--r--platform/javascript/export/export.cpp12
-rw-r--r--platform/linuxbsd/display_server_x11.cpp4
-rw-r--r--platform/linuxbsd/os_linuxbsd.cpp4
-rw-r--r--platform/osx/export/export.cpp6
-rw-r--r--platform/osx/os_osx.mm2
-rw-r--r--platform/uwp/export/export.cpp12
-rw-r--r--platform/windows/export/export.cpp2
12 files changed, 67 insertions, 67 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index eed3b226c8..41cff4bc74 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -647,7 +647,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
if (DirAccess::exists(plugins_dir)) {
Vector<String> plugins_filenames = list_gdap_files(plugins_dir);
- if (!plugins_filenames.empty()) {
+ if (!plugins_filenames.is_empty()) {
Ref<ConfigFile> config_file = memnew(ConfigFile);
for (int i = 0; i < plugins_filenames.size(); i++) {
PluginConfig config = load_plugin_config(config_file, plugins_dir.plus_file(plugins_filenames[i]));
@@ -750,7 +750,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
PackedStringArray user_perms = p_preset->get("permissions/custom_permissions");
for (int i = 0; i < user_perms.size(); i++) {
String user_perm = user_perms[i].strip_edges();
- if (!user_perm.empty()) {
+ if (!user_perm.is_empty()) {
r_permissions.push_back(user_perm);
}
}
@@ -975,7 +975,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
encode_uint32(xr_mode_index == /* XRMode.OVR */ 1 && focus_awareness ? 0xFFFFFFFF : 0, &p_manifest.write[iofs + 16]);
}
- if (tname == "meta-data" && attrname == "value" && value == "plugins_value" && !plugins_names.empty()) {
+ if (tname == "meta-data" && attrname == "value" && value == "plugins_value" && !plugins_names.is_empty()) {
// Update the meta-data 'android:value' attribute with the list of enabled plugins.
string_table.write[attr_value] = plugins_names;
}
@@ -1471,7 +1471,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
// TODO: Figure out how to handle remaining boot splash parameters (e.g: fullsize, filter)
String project_splash_path = ProjectSettings::get_singleton()->get("application/boot_splash/image");
- if (!project_splash_path.empty()) {
+ if (!project_splash_path.is_empty()) {
splash_image.instance();
const Error err = ImageLoader::load_image(project_splash_path, splash_image);
if (err) {
@@ -1505,19 +1505,19 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
// Regular icon: user selection -> project icon -> default.
String path = static_cast<String>(p_preset->get(launcher_icon_option)).strip_edges();
- if (path.empty() || ImageLoader::load_image(path, icon) != OK) {
+ if (path.is_empty() || ImageLoader::load_image(path, icon) != OK) {
ImageLoader::load_image(project_icon_path, icon);
}
// Adaptive foreground: user selection -> regular icon (user selection -> project icon -> default).
path = static_cast<String>(p_preset->get(launcher_adaptive_icon_foreground_option)).strip_edges();
- if (path.empty() || ImageLoader::load_image(path, foreground) != OK) {
+ if (path.is_empty() || ImageLoader::load_image(path, foreground) != OK) {
foreground = icon;
}
// Adaptive background: user selection -> default.
path = static_cast<String>(p_preset->get(launcher_adaptive_icon_background_option)).strip_edges();
- if (!path.empty()) {
+ if (!path.is_empty()) {
ImageLoader::load_image(path, background);
}
}
@@ -1538,14 +1538,14 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
const Ref<Image> &foreground,
const Ref<Image> &background) {
// Store the splash image
- if (splash_image.is_valid() && !splash_image->empty()) {
+ if (splash_image.is_valid() && !splash_image->is_empty()) {
Vector<uint8_t> data;
_load_image_data(splash_image, data);
store_image(SPLASH_IMAGE_EXPORT_PATH, data);
}
// Store the splash bg color image
- if (splash_bg_color_image.is_valid() && !splash_bg_color_image->empty()) {
+ if (splash_bg_color_image.is_valid() && !splash_bg_color_image->is_empty()) {
Vector<uint8_t> data;
_load_image_data(splash_bg_color_image, data);
store_image(SPLASH_BG_COLOR_PATH, data);
@@ -1555,20 +1555,20 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
// the default image from the export template will be used.
for (int i = 0; i < icon_densities_count; ++i) {
- if (main_image.is_valid() && !main_image->empty()) {
+ if (main_image.is_valid() && !main_image->is_empty()) {
Vector<uint8_t> data;
_process_launcher_icons(launcher_icons[i].export_path, main_image, launcher_icons[i].dimensions, data);
store_image(launcher_icons[i], data);
}
- if (foreground.is_valid() && !foreground->empty()) {
+ if (foreground.is_valid() && !foreground->is_empty()) {
Vector<uint8_t> data;
_process_launcher_icons(launcher_adaptive_icon_foregrounds[i].export_path, foreground,
launcher_adaptive_icon_foregrounds[i].dimensions, data);
store_image(launcher_adaptive_icon_foregrounds[i], data);
}
- if (background.is_valid() && !background->empty()) {
+ if (background.is_valid() && !background->is_empty()) {
Vector<uint8_t> data;
_process_launcher_icons(launcher_adaptive_icon_backgrounds[i].export_path, background,
launcher_adaptive_icon_backgrounds[i].dimensions, data);
@@ -1962,7 +1962,7 @@ public:
String rk = p_preset->get("keystore/release");
- if (!rk.empty() && !FileAccess::exists(rk)) {
+ if (!rk.is_empty() && !FileAccess::exists(rk)) {
valid = false;
err += TTR("Release keystore incorrectly configured in the export preset.") + "\n";
}
@@ -2019,7 +2019,7 @@ public:
// Ensure that `Use Custom Build` is enabled if a plugin is selected.
String enabled_plugins_names = get_plugins_names(get_enabled_plugins(p_preset));
bool custom_build_enabled = p_preset->get("custom_template/use_custom_build");
- if (!enabled_plugins_names.empty() && !custom_build_enabled) {
+ if (!enabled_plugins_names.is_empty() && !custom_build_enabled) {
valid = false;
err += TTR("\"Use Custom Build\" must be enabled to use the plugins.");
err += "\n";
@@ -2189,7 +2189,7 @@ public:
password = p_preset->get("keystore/debug_password");
user = p_preset->get("keystore/debug_user");
- if (keystore.empty()) {
+ if (keystore.is_empty()) {
keystore = EditorSettings::get_singleton()->get("export/android/debug_keystore");
password = EditorSettings::get_singleton()->get("export/android/debug_keystore_pass");
user = EditorSettings::get_singleton()->get("export/android/debug_keystore_user");
@@ -2549,27 +2549,27 @@ public:
}
// Process the splash image
- if (file == SPLASH_IMAGE_EXPORT_PATH && splash_image.is_valid() && !splash_image->empty()) {
+ if (file == SPLASH_IMAGE_EXPORT_PATH && splash_image.is_valid() && !splash_image->is_empty()) {
_load_image_data(splash_image, data);
}
// Process the splash bg color image
- if (file == SPLASH_BG_COLOR_PATH && splash_bg_color_image.is_valid() && !splash_bg_color_image->empty()) {
+ if (file == SPLASH_BG_COLOR_PATH && splash_bg_color_image.is_valid() && !splash_bg_color_image->is_empty()) {
_load_image_data(splash_bg_color_image, data);
}
for (int i = 0; i < icon_densities_count; ++i) {
- if (main_image.is_valid() && !main_image->empty()) {
+ if (main_image.is_valid() && !main_image->is_empty()) {
if (file == launcher_icons[i].export_path) {
_process_launcher_icons(file, main_image, launcher_icons[i].dimensions, data);
}
}
- if (foreground.is_valid() && !foreground->empty()) {
+ if (foreground.is_valid() && !foreground->is_empty()) {
if (file == launcher_adaptive_icon_foregrounds[i].export_path) {
_process_launcher_icons(file, foreground, launcher_adaptive_icon_foregrounds[i].dimensions, data);
}
}
- if (background.is_valid() && !background->empty()) {
+ if (background.is_valid() && !background->is_empty()) {
if (file == launcher_adaptive_icon_backgrounds[i].export_path) {
_process_launcher_icons(file, background, launcher_adaptive_icon_backgrounds[i].dimensions, data);
}
@@ -2620,7 +2620,7 @@ public:
ret = unzGoToNextFile(pkg);
}
- if (!invalid_abis.empty()) {
+ if (!invalid_abis.is_empty()) {
String unsupported_arch = String(", ").join(invalid_abis);
EditorNode::add_io_error("Missing libraries in the export template for the selected architectures: " + unsupported_arch + ".\n" +
"Please build a template with all required libraries, or uncheck the missing architectures in the export preset.");
diff --git a/platform/android/export/gradle_export_util.h b/platform/android/export/gradle_export_util.h
index a9f38869e0..7e1ff2e026 100644
--- a/platform/android/export/gradle_export_util.h
+++ b/platform/android/export/gradle_export_util.h
@@ -261,7 +261,7 @@ String _get_instrumentation_tag(const Ref<EditorExportPreset> &p_preset) {
}
String _get_plugins_tag(const String &plugins_names) {
- if (!plugins_names.empty()) {
+ if (!plugins_names.is_empty()) {
return vformat(" <meta-data tools:node=\"replace\" android:name=\"plugins\" android:value=\"%s\" />\n", plugins_names);
} else {
return " <meta-data tools:node=\"remove\" android:name=\"plugins\" />\n";
diff --git a/platform/android/plugin/godot_plugin_config.h b/platform/android/plugin/godot_plugin_config.h
index ecb9c0c7f5..26876b640f 100644
--- a/platform/android/plugin/godot_plugin_config.h
+++ b/platform/android/plugin/godot_plugin_config.h
@@ -101,7 +101,7 @@ struct PluginConfig {
static inline String resolve_local_dependency_path(String plugin_config_dir, String dependency_path) {
String absolute_path;
- if (!dependency_path.empty()) {
+ if (!dependency_path.is_empty()) {
if (dependency_path.is_abs_path()) {
absolute_path = ProjectSettings::get_singleton()->globalize_path(dependency_path);
} else {
@@ -115,7 +115,7 @@ static inline String resolve_local_dependency_path(String plugin_config_dir, Str
static inline PluginConfig resolve_prebuilt_plugin(PluginConfig prebuilt_plugin, String plugin_config_dir) {
PluginConfig resolved = prebuilt_plugin;
resolved.binary = resolved.binary_type == BINARY_TYPE_LOCAL ? resolve_local_dependency_path(plugin_config_dir, prebuilt_plugin.binary) : prebuilt_plugin.binary;
- if (!prebuilt_plugin.local_dependencies.empty()) {
+ if (!prebuilt_plugin.local_dependencies.is_empty()) {
resolved.local_dependencies.clear();
for (int i = 0; i < prebuilt_plugin.local_dependencies.size(); i++) {
resolved.local_dependencies.push_back(resolve_local_dependency_path(plugin_config_dir, prebuilt_plugin.local_dependencies[i]));
@@ -131,19 +131,19 @@ static inline Vector<PluginConfig> get_prebuilt_plugins(String plugins_base_dir)
}
static inline bool is_plugin_config_valid(PluginConfig plugin_config) {
- bool valid_name = !plugin_config.name.empty();
+ bool valid_name = !plugin_config.name.is_empty();
bool valid_binary_type = plugin_config.binary_type == BINARY_TYPE_LOCAL ||
plugin_config.binary_type == BINARY_TYPE_REMOTE;
bool valid_binary = false;
if (valid_binary_type) {
- valid_binary = !plugin_config.binary.empty() &&
+ valid_binary = !plugin_config.binary.is_empty() &&
(plugin_config.binary_type == BINARY_TYPE_REMOTE ||
FileAccess::exists(plugin_config.binary));
}
bool valid_local_dependencies = true;
- if (!plugin_config.local_dependencies.empty()) {
+ if (!plugin_config.local_dependencies.is_empty()) {
for (int i = 0; i < plugin_config.local_dependencies.size(); i++) {
if (!FileAccess::exists(plugin_config.local_dependencies[i])) {
valid_local_dependencies = false;
@@ -182,7 +182,7 @@ static inline PluginConfig load_plugin_config(Ref<ConfigFile> config_file, const
if (config_file->has_section(DEPENDENCIES_SECTION)) {
Vector<String> local_dependencies_paths = config_file->get_value(DEPENDENCIES_SECTION, DEPENDENCIES_LOCAL_KEY, Vector<String>());
- if (!local_dependencies_paths.empty()) {
+ if (!local_dependencies_paths.is_empty()) {
for (int i = 0; i < local_dependencies_paths.size(); i++) {
plugin_config.local_dependencies.push_back(resolve_local_dependency_path(config_base_dir, local_dependencies_paths[i]));
}
@@ -202,7 +202,7 @@ static inline PluginConfig load_plugin_config(Ref<ConfigFile> config_file, const
static inline String get_plugins_binaries(String binary_type, Vector<PluginConfig> plugins_configs) {
String plugins_binaries;
- if (!plugins_configs.empty()) {
+ if (!plugins_configs.is_empty()) {
Vector<String> binaries;
for (int i = 0; i < plugins_configs.size(); i++) {
PluginConfig config = plugins_configs[i];
@@ -231,7 +231,7 @@ static inline String get_plugins_binaries(String binary_type, Vector<PluginConfi
static inline String get_plugins_custom_maven_repos(Vector<PluginConfig> plugins_configs) {
String custom_maven_repos;
- if (!plugins_configs.empty()) {
+ if (!plugins_configs.is_empty()) {
Vector<String> repos_urls;
for (int i = 0; i < plugins_configs.size(); i++) {
PluginConfig config = plugins_configs[i];
@@ -249,7 +249,7 @@ static inline String get_plugins_custom_maven_repos(Vector<PluginConfig> plugins
static inline String get_plugins_names(Vector<PluginConfig> plugins_configs) {
String plugins_names;
- if (!plugins_configs.empty()) {
+ if (!plugins_configs.is_empty()) {
Vector<String> names;
for (int i = 0; i < plugins_configs.size(); i++) {
PluginConfig config = plugins_configs[i];
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index 3406c75c35..7cd67bc0ad 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -218,7 +218,7 @@ public:
da->list_dir_begin();
while (true) {
String file = da->get_next();
- if (file.empty()) {
+ if (file.is_empty()) {
break;
}
@@ -259,7 +259,7 @@ public:
if (DirAccess::exists(plugins_dir)) {
Vector<String> plugins_filenames = list_plugin_config_files(plugins_dir, true);
- if (!plugins_filenames.empty()) {
+ if (!plugins_filenames.is_empty()) {
Ref<ConfigFile> config_file = memnew(ConfigFile);
for (int i = 0; i < plugins_filenames.size(); i++) {
PluginConfig config = load_plugin_config(config_file, plugins_dir.plus_file(plugins_filenames[i]));
@@ -815,7 +815,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor
const String splash_path = ProjectSettings::get_singleton()->get("application/boot_splash/image");
- if (!splash_path.empty()) {
+ if (!splash_path.is_empty()) {
splash.instance();
const Error err = splash->load(splash_path);
if (err) {
@@ -1430,7 +1430,7 @@ Error EditorExportPlatformIOS::_export_ios_plugins(const Ref<EditorExportPreset>
String key = *K;
String value = plugin.plist[key];
- if (key.empty() || value.empty()) {
+ if (key.is_empty() || value.is_empty()) {
continue;
}
@@ -1457,7 +1457,7 @@ Error EditorExportPlatformIOS::_export_ios_plugins(const Ref<EditorExportPreset>
String key = *K;
String value = plist_values[key];
- if (key.empty() || value.empty()) {
+ if (key.is_empty() || value.is_empty()) {
continue;
}
@@ -1930,7 +1930,7 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset
err += etc_error;
}
- if (!err.empty()) {
+ if (!err.is_empty()) {
r_error = err;
}
diff --git a/platform/iphone/plugin/godot_plugin_config.h b/platform/iphone/plugin/godot_plugin_config.h
index 5323f94989..e536616994 100644
--- a/platform/iphone/plugin/godot_plugin_config.h
+++ b/platform/iphone/plugin/godot_plugin_config.h
@@ -97,7 +97,7 @@ struct PluginConfig {
static inline String resolve_local_dependency_path(String plugin_config_dir, String dependency_path) {
String absolute_path;
- if (dependency_path.empty()) {
+ if (dependency_path.is_empty()) {
return absolute_path;
}
@@ -114,7 +114,7 @@ static inline String resolve_local_dependency_path(String plugin_config_dir, Str
static inline String resolve_system_dependency_path(String dependency_path) {
String absolute_path;
- if (dependency_path.empty()) {
+ if (dependency_path.is_empty()) {
return absolute_path;
}
@@ -133,7 +133,7 @@ static inline Vector<String> resolve_local_dependencies(String plugin_config_dir
for (int i = 0; i < p_paths.size(); i++) {
String path = resolve_local_dependency_path(plugin_config_dir, p_paths[i]);
- if (path.empty()) {
+ if (path.is_empty()) {
continue;
}
@@ -149,7 +149,7 @@ static inline Vector<String> resolve_system_dependencies(Vector<String> p_paths)
for (int i = 0; i < p_paths.size(); i++) {
String path = resolve_system_dependency_path(p_paths[i]);
- if (path.empty()) {
+ if (path.is_empty()) {
continue;
}
@@ -160,10 +160,10 @@ static inline Vector<String> resolve_system_dependencies(Vector<String> p_paths)
}
static inline bool validate_plugin(PluginConfig &plugin_config) {
- bool valid_name = !plugin_config.name.empty();
- bool valid_binary_name = !plugin_config.binary.empty();
- bool valid_initialize = !plugin_config.initialization_method.empty();
- bool valid_deinitialize = !plugin_config.deinitialization_method.empty();
+ bool valid_name = !plugin_config.name.is_empty();
+ bool valid_binary_name = !plugin_config.binary.is_empty();
+ bool valid_initialize = !plugin_config.initialization_method.is_empty();
+ bool valid_deinitialize = !plugin_config.deinitialization_method.is_empty();
bool fields_value = valid_name && valid_binary_name && valid_initialize && valid_deinitialize;
@@ -247,7 +247,7 @@ static inline PluginConfig load_plugin_config(Ref<ConfigFile> config_file, const
for (int i = 0; i < keys.size(); i++) {
String value = config_file->get_value(PLIST_SECTION, keys[i], String());
- if (value.empty()) {
+ if (value.is_empty()) {
continue;
}
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index 37681b2484..6ae49c2162 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -119,7 +119,7 @@ public:
filepath = cache_path.plus_file(req[1].get_file()); // TODO dangerous?
ctype = "application/wasm";
}
- if (filepath.empty() || !FileAccess::exists(filepath)) {
+ if (filepath.is_empty() || !FileAccess::exists(filepath)) {
String s = "HTTP/1.1 404 Not Found\r\n";
s += "Connection: Close\r\n";
s += "\r\n";
@@ -394,7 +394,7 @@ bool EditorExportPlatformJavaScript::can_export(const Ref<EditorExportPreset> &p
}
}
- if (!err.empty()) {
+ if (!err.is_empty()) {
r_error = err;
}
@@ -485,7 +485,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
//write
if (file == "godot.html") {
- if (!custom_html.empty()) {
+ if (!custom_html.is_empty()) {
continue;
}
_fix_html(data, p_preset, p_path.get_file().get_basename(), p_debug, p_flags, shared_objects);
@@ -520,7 +520,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
} while (unzGoToNextFile(pkg) == UNZ_OK);
unzClose(pkg);
- if (!custom_html.empty()) {
+ if (!custom_html.is_empty()) {
FileAccess *f = FileAccess::open(custom_html, FileAccess::READ);
if (!f) {
EditorNode::get_singleton()->show_warning(TTR("Could not read custom HTML shell:") + "\n" + custom_html);
@@ -543,7 +543,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
Ref<Image> splash;
const String splash_path = String(GLOBAL_GET("application/boot_splash/image")).strip_edges();
- if (!splash_path.empty()) {
+ if (!splash_path.is_empty()) {
splash.instance();
const Error err = splash->load(splash_path);
if (err) {
@@ -564,7 +564,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
// This way, the favicon can be displayed immediately when loading the page.
Ref<Image> favicon;
const String favicon_path = String(GLOBAL_GET("application/config/icon")).strip_edges();
- if (!favicon_path.empty()) {
+ if (!favicon_path.is_empty()) {
favicon.instance();
const Error err = favicon->load(favicon_path);
if (err) {
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp
index 7e58272208..9669de5ed6 100644
--- a/platform/linuxbsd/display_server_x11.cpp
+++ b/platform/linuxbsd/display_server_x11.cpp
@@ -622,7 +622,7 @@ String DisplayServerX11::_clipboard_get(Atom p_source, Window x11_window) const
if (utf8_atom != None) {
ret = _clipboard_get_impl(p_source, x11_window, utf8_atom);
}
- if (ret.empty()) {
+ if (ret.is_empty()) {
ret = _clipboard_get_impl(p_source, x11_window, XA_STRING);
}
return ret;
@@ -634,7 +634,7 @@ String DisplayServerX11::clipboard_get() const {
String ret;
ret = _clipboard_get(XInternAtom(x11_display, "CLIPBOARD", 0), windows[MAIN_WINDOW_ID].x11_window);
- if (ret.empty()) {
+ if (ret.is_empty()) {
ret = _clipboard_get(XA_PRIMARY, windows[MAIN_WINDOW_ID].x11_window);
}
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp
index ac88d457a7..0bdf8dbf2e 100644
--- a/platform/linuxbsd/os_linuxbsd.cpp
+++ b/platform/linuxbsd/os_linuxbsd.cpp
@@ -65,9 +65,9 @@ void OS_LinuxBSD::initialize_joypads() {
String OS_LinuxBSD::get_unique_id() const {
static String machine_id;
- if (machine_id.empty()) {
+ if (machine_id.is_empty()) {
if (FileAccess *f = FileAccess::open("/etc/machine-id", FileAccess::READ)) {
- while (machine_id.empty() && !f->eof_reached()) {
+ while (machine_id.is_empty() && !f->eof_reached()) {
machine_id = f->get_line().strip_edges();
}
f->close();
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index eecd2ed641..57ad6dc688 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -457,7 +457,7 @@ Error EditorExportPlatformOSX::_code_sign(const Ref<EditorExportPreset> &p_prese
PackedStringArray user_args = p_preset->get("codesign/custom_options");
for (int i = 0; i < user_args.size(); i++) {
String user_arg = user_args[i].strip_edges();
- if (!user_arg.empty()) {
+ if (!user_arg.is_empty()) {
args.push_back(user_arg);
}
}
@@ -665,7 +665,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
Ref<Image> icon;
icon.instance();
icon->load(iconpath);
- if (!icon->empty()) {
+ if (!icon->is_empty()) {
_make_icon(icon, data);
}
}
@@ -927,7 +927,7 @@ bool EditorExportPlatformOSX::can_export(const Ref<EditorExportPreset> &p_preset
}
}
- if (!err.empty()) {
+ if (!err.is_empty()) {
r_error = err;
}
return valid;
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index ed03e953a5..3c9dbcb432 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -99,7 +99,7 @@ public:
String OS_OSX::get_unique_id() const {
static String serial_number;
- if (serial_number.empty()) {
+ if (serial_number.is_empty()) {
io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
CFStringRef serialNumberAsCFString = NULL;
if (platformExpert) {
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp
index 00b57c48f3..344521baf1 100644
--- a/platform/uwp/export/export.cpp
+++ b/platform/uwp/export/export.cpp
@@ -641,7 +641,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
};
bool _valid_resource_name(const String &p_name) const {
- if (p_name.empty()) {
+ if (p_name.is_empty()) {
return false;
}
if (p_name.ends_with(".")) {
@@ -687,7 +687,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
}
bool _valid_bgcolor(const String &p_color) const {
- if (p_color.empty()) {
+ if (p_color.is_empty()) {
return true;
}
if (p_color.begins_with("#") && p_color.is_valid_html_color()) {
@@ -763,7 +763,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
String architecture = arch == ARM ? "arm" : arch == X86 ? "x86" : "x64";
result = result.replace("$architecture$", architecture);
- result = result.replace("$display_name$", String(p_preset->get("package/display_name")).empty() ? (String)ProjectSettings::get_singleton()->get("application/config/name") : String(p_preset->get("package/display_name")));
+ result = result.replace("$display_name$", String(p_preset->get("package/display_name")).is_empty() ? (String)ProjectSettings::get_singleton()->get("application/config/name") : String(p_preset->get("package/display_name")));
result = result.replace("$publisher_display_name$", p_preset->get("package/publisher_display_name"));
result = result.replace("$app_description$", p_preset->get("package/description"));
@@ -782,7 +782,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
}
String show_name_on_tiles = "";
- if (!name_on_tiles.empty()) {
+ if (!name_on_tiles.is_empty()) {
show_name_on_tiles = "<uap:ShowNameOnTiles>\n" + name_on_tiles + " </uap:ShowNameOnTiles>";
}
@@ -803,7 +803,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
}
String rotation_preference = "";
- if (!rotations.empty()) {
+ if (!rotations.is_empty()) {
rotation_preference = "<uap:InitialRotationPreference>\n" + rotations + " </uap:InitialRotationPreference>";
}
@@ -837,7 +837,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
}
String capabilities_string = "<Capabilities />";
- if (!capabilities_elements.empty()) {
+ if (!capabilities_elements.is_empty()) {
capabilities_string = "<Capabilities>\n" + capabilities_elements + " </Capabilities>";
}
diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp
index c2436e8b64..58c814b1c4 100644
--- a/platform/windows/export/export.cpp
+++ b/platform/windows/export/export.cpp
@@ -299,7 +299,7 @@ Error EditorExportPlatformWindows::_code_sign(const Ref<EditorExportPreset> &p_p
PackedStringArray user_args = p_preset->get("codesign/custom_options");
for (int i = 0; i < user_args.size(); i++) {
String user_arg = user_args[i].strip_edges();
- if (!user_arg.empty()) {
+ if (!user_arg.is_empty()) {
args.push_back(user_arg);
}
}