xdg-desktop-portal
xdg-desktop-portal copied to clipboard
file transfer does not handle folders
This was reported here: https://gitlab.gnome.org/GNOME/gtk/-/issues/5348
The underlying issue is that AddFiles validates the fds by passing VALIDATE_FD_FILE_TYPE_REGULAR to validate_fd().
I think we should probably add an AddFolders method to the DBus interface.
Alternatively, we could invent some way to validate the fds as 'either regular or folder'
this function would be amazing!
Picking this up.
I've played a bit with the idea of adding an AddFolders
method, which is trivial on the portal side, but gets messy on the toolkit/application side. Aside from the duplication of code paths, it gets "funny" once you start accumulating file descriptors to send over the wire: it means you cannot interleave AddFiles
and AddFolders
calls, which is hard to detect on the portal side.
An easier option is to use VALIDATE_FD_FILE_TYPE_ANY
inside the file transfer portal, which will validate both files and directories; the document portal already supports this, so it should be fine.
Of course, easier said than done: the documents are added in bulk, and the document portal API still requires a split path for adding files and directories.
See #1196