Skip to content

KUrlRequester::setFilter: note special filter syntax, allow unnamed filters

Friedrich W. H. Kossebau requested to merge work/kossebau/fixfilterconversion into kf5

The API dox refers to QFileDialog::setNameFilters for the syntax to use which is "Comment (file pattern)". The internal logic still supporting the old KDE style syntax "file pattern|Comment" though breaks the Qt syntax due to (meanwhile?) bad handling of non-existing "|" hit.

Keeping support for the old KDE style for now as some code might rely on this, either not knowning about the new style or as work-around of the broken support for the QFileDialog syntax.

The API dox referred to QFileDialog::setNameFilters for the syntax to use which is "Comment (file pattern)". The internal logic though expects the old KDE style syntax "file pattern|Comment".

For more compatibility with Qt also allow name/comment-less filters by handling of non-existing "|" hit in the filter parsing.

CCBUG: 464350

CCBUG: 369542

Edited by Friedrich W. H. Kossebau

Merge request reports