Summary: | Portal FileChooser incorrectly handles mnemonics | ||
---|---|---|---|
Product: | [Plasma] xdg-desktop-portal-kde | Reporter: | Michael Weghorn <m.weghorn> |
Component: | general | Assignee: | Jan Grulich <jgrulich> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jgrulich, m.weghorn |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/daab5c525e7aa14fbd63f678adc5f900e627a839 | Version Fixed In: | |
Attachments: |
Screenshot of the portal-native KF5 file save dialog used with simple-scan
Sample Gtk program to demonstrate the issue. |
Description
Michael Weghorn
2020-06-01 19:16:43 UTC
Created attachment 128979 [details]
Sample Gtk program to demonstrate the issue.
I have a potential fix at [1]. I did not submit a merge request right away, since that commit is on a branch [2] that has more changes for the FileChooser portal, and I think it makes sense to handle the underlying commits first to avoid merge conflicts in the merge requests. For the first two commits, those pending merge requests are [3] and [4]. Please let me know if you want me to submit a merge request for this bug right away instead, and I'll rearrange those commits then. [1] https://invent.kde.org/michaelweghorn/xdg-desktop-portal-kde/-/commit/211b31cad57f332948617cee2d9613e80693169e [2] https://invent.kde.org/michaelweghorn/xdg-desktop-portal-kde/-/tree/michaelweghorn/filechooser_properly_handle_mnemonics_in_accept_label [3] https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/2 [4] https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/3 (In reply to Michael Weghorn from comment #2) > I have a potential fix at [1]. I did not submit a merge request right away, > since that commit is on a branch [2] that has more changes for the > FileChooser portal, and I think it makes sense to handle the underlying > commits first to avoid merge conflicts in the merge requests. > > For the first two commits, those pending merge requests are [3] and [4]. > > Please let me know if you want me to submit a merge request for this bug > right away instead, and I'll rearrange those commits then. > > [1] > https://invent.kde.org/michaelweghorn/xdg-desktop-portal-kde/-/commit/ > 211b31cad57f332948617cee2d9613e80693169e > [2] > https://invent.kde.org/michaelweghorn/xdg-desktop-portal-kde/-/tree/ > michaelweghorn/filechooser_properly_handle_mnemonics_in_accept_label > [3] https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/2 > [4] https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/3 Do you plan to submit your change now? (In reply to Jan Grulich from comment #3) > Do you plan to submit your change now? Yes; thanks for all the reviews. I've submitted an MR now: https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/7 Git commit daab5c525e7aa14fbd63f678adc5f900e627a839 by Michael Weghorn. Committed on 25/07/2020 at 20:15. Pushed by grulich into branch 'master'. FileChooser: Properly handle mnemonics in 'accept_label' The FileChooser portal doc [1] for 'accept_label' says: > accept_label s > > The label for the accept button. Mnemonic underlines are allowed. Since Qt does not use underscores/underlines, but the ampersand character ('&') for mnemonics, convert the retrieved text accordingly, to make the mnemonic applied at the correct position and preserve literal '&'s. [1] https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-org.freedesktop.impl.portal.FileChooser M +18 -8 src/filechooser.cpp M +2 -0 src/filechooser.h https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/daab5c525e7aa14fbd63f678adc5f900e627a839 |