Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-100297

QXdgDesktopPortalFileDialog::openPortal() does not set current_name

XMLWordPrintable

    • Linux/Wayland, Linux/X11
    • 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)

      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.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jgrulich Jan Grulich
            ppd Maximilian Federle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes