fix: use gio as default linux trash impl (#15399)

* fix: use gio as default linux trash impl

* doc: add ELECTRON_TRASH env var
This commit is contained in:
Shelley Vohr 2018-10-26 08:36:56 -07:00 committed by GitHub
parent 7a03e5f0b2
commit bea4de9262
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 4 deletions

View file

@ -16,7 +16,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);

View file

@ -80,6 +80,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