Diffusion KIO c4e90b5a6bf4

Test current filter before setting a new one

Authored by jglogowski on May 21 2019, 7:45 PM.

Description

Test current filter before setting a new one

Summary:
If KFileWidget's filter list has two matching filters for an extension,
it will always select the first filter, even if the current filter
already matches the file name.

This is fine, if you auto-select the filter to match the file name, but
breaks, if you want to auto-change the file name's extension via the
selected filter.

So this checks, if the current filter already matches the file name
before trying to find a matching filter and select it.

BUG: 407642

Test Plan:

  1. Compile and run the attached program to the bug report 407642
  2. Make sure that "auto extension" checkbox is enable
  3. Select the last file filter (DocBook (.xml)) via dropdown list

OBSERVED RESULT
Filter is "Word 2003 XML (.xml)"

EXPECTED RESULT
Filter is "DocBook (.xml)"

Reviewers: Frameworks, ngraham, dfaure

Reviewed By: dfaure

Subscribers: elvisangelaccio, ngraham, michaelweghorn, kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D21249

Details

Committed
ngrahamMay 21 2019, 7:49 PM
Reviewer
dfaure
Differential Revision
D21249: Test current filter before setting a new one
Parents
R241:6738a8b2f71c: [kioslave/file] Add a codec for legacy filenames
Branches
Unknown
Tags
Unknown