gfile: Add support for x-gvfs-trash mount option

Currently, the trash functionality is disabled for system internal mounts.
That might be a problem in some cases. The `x-gvfs-notrash` mount option
allows disabling the trash functionality for certain mounts. Let's add
support for the `x-gvfs-trash` mount option to allow the opposite.

See: https://issues.redhat.com/browse/RHEL-46828
This commit is contained in:
Ondrej Holy
2024-07-12 11:14:10 +02:00
parent 79c57b5b80
commit d9fec76b59
2 changed files with 18 additions and 11 deletions

View File

@@ -4744,10 +4744,13 @@ g_file_delete_finish (GFile *file,
*
* Sends @file to the "Trashcan", if possible. This is similar to
* deleting it, but the user can recover it before emptying the trashcan.
* Not all file systems support trashing, so this call can return the
* Trashing is disabled for system mounts by default (see
* g_unix_mount_is_system_internal()), so this call can return the
* %G_IO_ERROR_NOT_SUPPORTED error. Since GLib 2.66, the `x-gvfs-notrash` unix
* mount option can be used to disable g_file_trash() support for certain
* mount option can be used to disable g_file_trash() support for particular
* mounts, the %G_IO_ERROR_NOT_SUPPORTED error will be returned in that case.
* Since 2.82, the `x-gvfs-trash` unix mount option can be used to enable
* g_file_trash() support for particular system mounts.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation