Summary: | Name filters with parenthesis in name are truncated with native KF6 file dialog | ||
---|---|---|---|
Product: | [Plasma] plasma-integration | Reporter: | Michael Weghorn <m.weghorn> |
Component: | general | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kdelibs-bugs, m.weghorn, nicolas.fella |
Priority: | NOR | Keywords: | qt6 |
Version: | 6.0.1 | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=481287 | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-integration/-/commit/efa61e7de254dd1184b73499adea5aba177e3db4 | Version Fixed In: | 6.0.2 |
Sentry Crash Report: | |||
Attachments: | Sample program to reproduce the bug |
Description
Michael Weghorn
2024-03-12 15:13:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-integration/-/merge_requests/140 Git commit 448b8aef5751608e6de05a8c31741cea1035dabb by Michael Weghorn. Committed on 12/03/2024 at 15:13. Pushed by nicolasfella into branch 'master'. Don't truncate filter name containing parenthesis When extracting the part of the string that contains the filter name, use the part in front of the *last* parenthesis, not the first one, since otherwise the name gets truncated if it contains parenthesis itself, e.g. in a call like QFileDialog dialog; dialog.setNameFilters({"ODF Spreadsheet (.ods) (*.ods)"}); This is in line with the fact that `QPlatformFileDialogHelper::cleanFilterList` just considers those extensions in the last set of parenthesis and aligns the behavior with the non-native QFileDialog implementation that the Qt library itself provides, as well as the KF 5 implementation. M +1 -1 qt6/src/platformtheme/kdeplatformfiledialoghelper.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/448b8aef5751608e6de05a8c31741cea1035dabb Git commit efa61e7de254dd1184b73499adea5aba177e3db4 by Nicolas Fella, on behalf of Michael Weghorn. Committed on 12/03/2024 at 15:24. Pushed by nicolasfella into branch 'Plasma/6.0'. Don't truncate filter name containing parenthesis When extracting the part of the string that contains the filter name, use the part in front of the *last* parenthesis, not the first one, since otherwise the name gets truncated if it contains parenthesis itself, e.g. in a call like QFileDialog dialog; dialog.setNameFilters({"ODF Spreadsheet (.ods) (*.ods)"}); This is in line with the fact that `QPlatformFileDialogHelper::cleanFilterList` just considers those extensions in the last set of parenthesis and aligns the behavior with the non-native QFileDialog implementation that the Qt library itself provides, as well as the KF 5 implementation. (cherry picked from commit 448b8aef5751608e6de05a8c31741cea1035dabb) M +1 -1 qt6/src/platformtheme/kdeplatformfiledialoghelper.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/efa61e7de254dd1184b73499adea5aba177e3db4 |