Skip to content

KCoreDirLister: un-anchor the regex pattern in setFilter()

Ahmad Samir requested to merge work/ahmad/kcoredirlister-filter into master

QRegularExpression::wildcardToRegularExpression() by default returns an anchored pattern, which means that if you search for e.g. copyjob, it'll only match if you search for exactly "copyjob.cpp", this can be seen in the "Filesystem Browser" plugin in Kate, that plugin uses KDirOperator to show a filesystem representation and has a search box.

This bug was "hidden" when I was fixing my QRegularExpression::wildcardToRegularExpression() ports some time ago, because I was testing with KFileWidget which changes the fitler string into 'filter', so that worked (see KFileWidgetPrivate::slotFilterChanged()).

Merge request reports