Summary: | KFileWidget returns wrong filter with enabled automatic extensions and extension used twice | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Michael Weghorn <m.weghorn> |
Component: | Open/save dialogs | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | glogow, kdelibs-bugs, m.weghorn, nate |
Priority: | NOR | ||
Version: | 5.54.0 | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/plasma-integration/0f529bca29ba020820b0702ec5e28e9346d1e76d | Version Fixed In: | |
Attachments: | Sample program to reproduce the issue |
Description
Michael Weghorn
2019-05-22 08:06:51 UTC
Pending chnage on Phabricator: https://phabricator.kde.org/D21959 Git commit 0f529bca29ba020820b0702ec5e28e9346d1e76d by David Faure, on behalf of Robert Hoffmann. Committed on 27/06/2019 at 19:18. Pushed by dfaure into branch 'Plasma/5.16'. Fix selectedNameFilter() multiple matches Summary: If your filter list has two matching filters for an extension, KFileWidget will return the name of the first filter when calling QFileDialog::selectedNameFilter(), even if the second filter was selected in the dialog. This is a follow-up for https://phabricator.kde.org/D21249 Test Plan: 1. Compile and run the attached program to the bug report 407819 2. Make sure that "auto extension" checkbox is enabled 3. Select the last file filter (DocBook (.xml)) via dropdown list 4. Click "Save" 5. Check program output Result without this patch: The output is "Word 2003 XML (.xml) (*.xml)" Result with this patch applied: The output should be "DocBook (.xml) (*.xml)", since this was selected in the file dialog. Reviewers: #frameworks, apol, dfaure Reviewed By: dfaure Subscribers: michaelweghorn, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D21959 M +17 -0 autotests/kfiledialog_unittest.cpp M +1 -0 src/platformtheme/kdeplatformfiledialogbase_p.h M +9 -3 src/platformtheme/kdeplatformfiledialoghelper.cpp M +1 -0 src/platformtheme/kdeplatformfiledialoghelper.h M +5 -0 src/platformtheme/kdirselectdialog.cpp M +1 -0 src/platformtheme/kdirselectdialog_p.h https://commits.kde.org/plasma-integration/0f529bca29ba020820b0702ec5e28e9346d1e76d |