Skip to content
  • Robert Hoffmann's avatar
    Fix selectedNameFilter() multiple matches · 0f529bca
    Robert Hoffmann authored and David Faure's avatar David Faure committed
    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.
    
    BUG: 407819
    
    Reviewers: #frameworks, apol, dfaure
    
    Reviewed By: dfaure
    
    Subscribers: michaelweghorn, plasma-devel
    
    Tags: #plasma
    
    Differential Revision: https://phabricator.kde.org/D21959
    0f529bca