Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.3, 6.3.0 Alpha
-
None
-
-
974a7bd6e0 (qt/qtbase/dev) d0f215f69e (qt/qtbase/6.3) d0f215f69e (qt/tqtc-qtbase/6.3) 974a7bd6e0 (qt/tqtc-qtbase/dev) b092606bed (qt/qtbase/6.2) b092606bed (qt/tqtc-qtbase/6.2)
Description
According to https://flatpak.github.io/xdg-desktop-portal/#gdbus-method-org-freedesktop-portal-FileChooser.SaveFile
the desktop portal's file chooser uses the option current_name to specify a default filename.
QXdgDesktopPortalFileDialog::openPortal() does not set this, and consequently Qt applications have no suggested filenames set when using the portal's file dialog.
This is unfortunate because the portal's file chooser might proxy the selected file into the confined app, i.e. it mounts the file to "/run/user/$UID/doc/filename". In this case, the only permissible filename for the application to use is "filename". However, most applications will try to append a suffix, which leads to lost files because the filenames will not match any more from the perspective of the document portal.
By pre-filling the preferred name, the chance of this happening is greatly reduced as the user is guided to using a sensible filename.
Suggestion: Set current_name to the preferred name.
Ping jgrulich, I think you wrote most of the portal support.
Attachments
Issue Links
- relates to
-
QTBUG-77825 QFileDialog::directory() returns the wrong directory with xdg-desktop-portal
- Reported
For Gerrit Dashboard: QTBUG-100297 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
405742,4 | FileChooser portal: set current_name | dev | qt/qtbase | Status: MERGED | +2 | 0 |
406083,2 | FileChooser portal: set current_name | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
406084,2 | FileChooser portal: set current_name | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |