Trash: libportal Reference Manual

## Trash Trash — send files to the trash |

## Functions

void | xdp_portal_trash_file ()
gboolean | xdp_portal_trash_file_finish ()

## Description

This function lets applications send a file to the trash can.

The underlying portal is org.freedesktop.portal.Trash.

## Functions

### xdp_portal_trash_file ()

    void
    xdp_portal_trash_file (XdpPortal *portal,
                           const char *path,
                           GCancellable *cancellable,
                           GAsyncReadyCallback callback,
                           gpointer data);

Sends the file at `path` to the trash can.

#### Parameters

portal | a XdpPortal |
path | the path for a local file |
cancellable | optional GCancellable. | [nullable]
callback | a callback to call when the request is done. | [scope async]
data | data to pass to `callback` . | [closure]

### xdp_portal_trash_file_finish ()

    gboolean
    xdp_portal_trash_file_finish (XdpPortal *portal,
                                  GAsyncResult *result,
                                  GError **error);

Finishes the trash-file request, and returns the result in the form of a boolean.

#### Parameters

portal | a XdpPortal |
result | a GAsyncResult |
error | return location for an error |

#### Returns

`TRUE` if the call succeeded

## Types and Values