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:
parent
7a03e5f0b2
commit
bea4de9262
2 changed files with 15 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
||||||
#include "url/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
#define ELECTRON_TRASH "ELECTRON_TRASH"
|
#define ELECTRON_TRASH "ELECTRON_TRASH"
|
||||||
#define ELECTRON_DEFAULT_TRASH "gvfs-trash"
|
#define ELECTRON_DEFAULT_TRASH "gio"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -126,12 +126,13 @@ bool MoveItemToTrash(const base::FilePath& full_path) {
|
||||||
} else if (trash.compare("trash-cli") == 0) {
|
} else if (trash.compare("trash-cli") == 0) {
|
||||||
argv.push_back("trash-put");
|
argv.push_back("trash-put");
|
||||||
argv.push_back(full_path.value());
|
argv.push_back(full_path.value());
|
||||||
} else if (trash.compare("gio") == 0) {
|
} else if (trash.compare("gvfs-trash") == 0) {
|
||||||
argv.push_back("gio");
|
// retain support for deprecated gvfs-trash
|
||||||
argv.push_back("trash");
|
argv.push_back("gvfs-trash");
|
||||||
argv.push_back(full_path.value());
|
argv.push_back(full_path.value());
|
||||||
} else {
|
} else {
|
||||||
argv.push_back(ELECTRON_DEFAULT_TRASH);
|
argv.push_back(ELECTRON_DEFAULT_TRASH);
|
||||||
|
argv.push_back("trash");
|
||||||
argv.push_back(full_path.value());
|
argv.push_back(full_path.value());
|
||||||
}
|
}
|
||||||
return XDGUtilV(argv, true);
|
return XDGUtilV(argv, true);
|
||||||
|
|
|
@ -80,6 +80,16 @@ Don't attach to the current console session.
|
||||||
|
|
||||||
Don't use the global menu bar on Linux.
|
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
|
## Development Variables
|
||||||
|
|
||||||
The following environment variables are intended primarily for development and
|
The following environment variables are intended primarily for development and
|
||||||
|
|
Loading…
Reference in a new issue