diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2020-09-23 09:36:32 +0000 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2020-09-23 09:36:32 +0000 |
commit | af0b0e98dafc5beafd4bbd8c2fe840d8bad14bb6 (patch) | |
tree | 70307543ecc1b3ac1416c34bfbaf898c8a793aca | |
parent | 298b712b2726624c9d806dcb949446d895adab87 (diff) | |
parent | 88032cb541fd5be40284dd10a58f7080e64b4979 (diff) | |
download | glib-af0b0e98dafc5beafd4bbd8c2fe840d8bad14bb6.tar.gz |
Merge branch 'trash-portal-error' into 'master'
trash portal: Handle portal failures
See merge request GNOME/glib!1652
-rw-r--r-- | gio/gtrashportal.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gio/gtrashportal.c b/gio/gtrashportal.c index 9922be21f..03c933297 100644 --- a/gio/gtrashportal.c +++ b/gio/gtrashportal.c @@ -74,8 +74,9 @@ g_trash_portal_trash_file (GFile *file, GUnixFDList *fd_list = NULL; int fd, fd_in, errsv; gboolean ret = FALSE; + guint portal_result = 0; GXdpTrash *proxy; - + proxy = ensure_trash_portal (); if (proxy == NULL) { @@ -114,11 +115,17 @@ g_trash_portal_trash_file (GFile *file, ret = gxdp_trash_call_trash_file_sync (proxy, g_variant_new_handle (fd_in), fd_list, - NULL, + &portal_result, NULL, NULL, error); + if (ret && portal_result != 1) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Trash portal failed on %s", path); + ret = FALSE; + } + out: g_clear_object (&fd_list); g_free (path); |