summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/os_linuxbsd.cpp
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/linuxbsd/os_linuxbsd.cpp
parent5ad9d8bad69309d71ea55f3d799af7e3711dc262 (diff)
parent49403cbfa0399bb4284ea5c36cc90216a0bda6ff (diff)
downloadredot-engine-bdf8340e5993ec3f86e4bf1d5ede48df7d023a12.tar.gz
Merge pull request #43181 from nathanfranke/string-empty
Replace String comparisons with "", String() to is_empty()
Diffstat (limited to 'platform/linuxbsd/os_linuxbsd.cpp')
-rw-r--r--platform/linuxbsd/os_linuxbsd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp
index 69474c6dec..c39b5cb784 100644
--- a/platform/linuxbsd/os_linuxbsd.cpp
+++ b/platform/linuxbsd/os_linuxbsd.cpp
@@ -419,7 +419,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
String mnt = get_mountpoint(p_path);
// If there is a directory "[Mountpoint]/.Trash-[UID], use it as the trash can.
- if (mnt != "") {
+ if (!mnt.is_empty()) {
String path(mnt + "/.Trash-" + itos(getuid()));
struct stat s;
if (!stat(path.utf8().get_data(), &s)) {
@@ -428,7 +428,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
}
// Otherwise, if ${XDG_DATA_HOME} is defined, use "${XDG_DATA_HOME}/Trash" as the trash can.
- if (trash_path == "") {
+ if (trash_path.is_empty()) {
char *dhome = getenv("XDG_DATA_HOME");
if (dhome) {
trash_path = String(dhome) + "/Trash";
@@ -436,7 +436,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
}
// Otherwise, if ${HOME} is defined, use "${HOME}/.local/share/Trash" as the trash can.
- if (trash_path == "") {
+ if (trash_path.is_empty()) {
char *home = getenv("HOME");
if (home) {
trash_path = String(home) + "/.local/share/Trash";
@@ -444,7 +444,7 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
}
// Issue an error if none of the previous locations is appropriate for the trash can.
- ERR_FAIL_COND_V_MSG(trash_path == "", FAILED, "Could not determine the trash can location");
+ ERR_FAIL_COND_V_MSG(trash_path.is_empty(), FAILED, "Could not determine the trash can location");
// Create needed directories for decided trash can location.
{