Skip to content

Restore old behavior for KFileFilterCombo::setFilter

Nicolas Fella requested to merge work/nico/restore-file-combo into master

fb2a2268 refactored it to use the newly introduced KFileFilter class to parse the input. However, it actually allows input that is not a valid filter string expression.

For example K3B uses filters like "audio/x-wav |Wave Sound Files", which are now parsed incorrectly.

Also, contrary to KFileWidget's filter strings slashes were allowed unescapted, which broke Krita.

K3B's usage of KFileFilterCombo for this is somewhat questionable, but we should not break it regardless.

Longer-term setFilter should be replaced with API that takes a KFileFilter object to avoid such confusion

Revert the implementation of setFilter to the original one. For setMimeFilter the usage of KFileFilter is fine. That means we now have separate codepaths for when setFilter and setMimeFilter was called. Longer-term there will be only one using KFileFilter

BUG: 463309

Merge request reports