Use KFileFilter in KFileWidget and KFileFilterCombo API
Current they have an API that supports filtering via name filters and mimetypes.
However those are mutually exclusive and one cannot filter on both at the same time, despite the underlying KDirOperator and KCoreDirList being able to do that.
The name-based filters expect a particular syntax that isn't ergonomic to use.
What's worse, the syntax is slightly different between various API calls, sometimes slashes must be escaped to avoid the pattern being interpreted as a MIME type, sometimes not.
KFileFilter was designed to model such filters and supports MIME and name patterns at the same time.
Use it to combine and replace the old API