summaryrefslogtreecommitdiff
path: root/platform/android/export
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-12-10 08:56:31 +0100
committerGitHub <noreply@github.com>2021-12-10 08:56:31 +0100
commitbdf8340e5993ec3f86e4bf1d5ede48df7d023a12 (patch)
tree1e366583662397e366d4f84bb334660db37cb5bd /platform/android/export
parent5ad9d8bad69309d71ea55f3d799af7e3711dc262 (diff)
parent49403cbfa0399bb4284ea5c36cc90216a0bda6ff (diff)
Merge pull request #43181 from nathanfranke/string-empty
Replace String comparisons with "", String() to is_empty()
Diffstat (limited to 'platform/android/export')
-rw-r--r--platform/android/export/export_plugin.cpp22
-rw-r--r--platform/android/export/gradle_export_util.cpp2
2 files changed, 12 insertions, 12 deletions
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index c554ca576e..70b36f2350 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -307,7 +307,7 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
}
}
- if (d.description == "") {
+ if (d.description.is_empty()) {
//in the oven, request!
args.clear();
args.push_back("-s");
@@ -356,7 +356,7 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
}
d.name = vendor + " " + device;
- if (device == String()) {
+ if (device.is_empty()) {
continue;
}
}
@@ -394,13 +394,13 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) {
String EditorExportPlatformAndroid::get_project_name(const String &p_name) const {
String aname;
- if (p_name != "") {
+ if (!p_name.is_empty()) {
aname = p_name;
} else {
aname = ProjectSettings::get_singleton()->get("application/config/name");
}
- if (aname == "") {
+ if (aname.is_empty()) {
aname = VERSION_NAME;
}
@@ -424,7 +424,7 @@ String EditorExportPlatformAndroid::get_package_name(const String &p_package) co
first = false;
}
}
- if (name == "") {
+ if (name.is_empty()) {
name = "noname";
}
@@ -581,7 +581,7 @@ Vector<String> EditorExportPlatformAndroid::list_gdap_files(const String &p_path
da->list_dir_begin();
while (true) {
String file = da->get_next();
- if (file == "") {
+ if (file.is_empty()) {
break;
}
@@ -2108,7 +2108,7 @@ bool EditorExportPlatformAndroid::can_export(const Ref<EditorExportPreset> &p_pr
}
String sdk_path = EditorSettings::get_singleton()->get("export/android/android_sdk_path");
- if (sdk_path == "") {
+ if (sdk_path.is_empty()) {
err += TTR("A valid Android SDK path is required in Editor Settings.") + "\n";
valid = false;
} else {
@@ -2155,7 +2155,7 @@ bool EditorExportPlatformAndroid::can_export(const Ref<EditorExportPreset> &p_pr
if (apk_expansion) {
String apk_expansion_pkey = p_preset->get("apk_expansion/public_key");
- if (apk_expansion_pkey == "") {
+ if (apk_expansion_pkey.is_empty()) {
valid = false;
err += TTR("Invalid public key for APK expansion.") + "\n";
@@ -2171,7 +2171,7 @@ bool EditorExportPlatformAndroid::can_export(const Ref<EditorExportPreset> &p_pr
}
String etc_error = test_etc2();
- if (etc_error != String()) {
+ if (!etc_error.is_empty()) {
valid = false;
err += etc_error;
}
@@ -2733,13 +2733,13 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
src_apk = p_preset->get("custom_template/release");
}
src_apk = src_apk.strip_edges();
- if (src_apk == "") {
+ if (src_apk.is_empty()) {
if (p_debug) {
src_apk = find_export_template("android_debug.apk");
} else {
src_apk = find_export_template("android_release.apk");
}
- if (src_apk == "") {
+ if (src_apk.is_empty()) {
EditorNode::add_io_error(vformat(TTR("Package not found: %s"), src_apk));
return ERR_FILE_NOT_FOUND;
}
diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp
index a498155bec..27c84baa44 100644
--- a/platform/android/export/gradle_export_util.cpp
+++ b/platform/android/export/gradle_export_util.cpp
@@ -161,7 +161,7 @@ Error _create_project_name_strings_files(const Ref<EditorExportPreset> &p_preset
da->list_dir_begin();
while (true) {
String file = da->get_next();
- if (file == "") {
+ if (file.is_empty()) {
break;
}
if (!file.begins_with("values-")) {