From b6b99661625679f38a552fe9dda5cfc1de9aac49 Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Fri, 26 Oct 2018 11:10:35 -0700 Subject: [PATCH] fix: use gio as default linux trash impl (backport: 3-0-x) (#15421) * fix: use gio as default linux trash impl * doc: add ELECTRON_TRASH env var --- atom/common/platform_util_linux.cc | 9 +++++---- docs/api/environment-variables.md | 10 ++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/atom/common/platform_util_linux.cc b/atom/common/platform_util_linux.cc index 8fad8609342a..7789bdb00656 100644 --- a/atom/common/platform_util_linux.cc +++ b/atom/common/platform_util_linux.cc @@ -15,7 +15,7 @@ #include "url/gurl.h" #define ELECTRON_TRASH "ELECTRON_TRASH" -#define ELECTRON_DEFAULT_TRASH "gvfs-trash" +#define ELECTRON_DEFAULT_TRASH "gio" namespace { @@ -126,12 +126,13 @@ bool MoveItemToTrash(const base::FilePath& full_path) { } else if (trash.compare("trash-cli") == 0) { argv.push_back("trash-put"); argv.push_back(full_path.value()); - } else if (trash.compare("gio") == 0) { - argv.push_back("gio"); - argv.push_back("trash"); + } else if (trash.compare("gvfs-trash") == 0) { + // retain support for deprecated gvfs-trash + argv.push_back("gvfs-trash"); argv.push_back(full_path.value()); } else { argv.push_back(ELECTRON_DEFAULT_TRASH); + argv.push_back("trash"); argv.push_back(full_path.value()); } return XDGUtilV(argv, true); diff --git a/docs/api/environment-variables.md b/docs/api/environment-variables.md index 72f75e6b8165..9fdc0507ce83 100644 --- a/docs/api/environment-variables.md +++ b/docs/api/environment-variables.md @@ -58,6 +58,16 @@ Don't attach to the current console session. Don't use the global menu bar on Linux. +### `ELECTRON_TRASH` _Linux_ + +Set the trash implementation on Linux. Default is `gio`. + +Options: +* `gvfs-trash` +* `trash-cli` +* `kioclient5` +* `kioclient` + ## Development Variables The following environment variables are intended primarily for development and