Make QRegularExpression filtering actually case-insensitive
ClosedPublic

Authored by ahmadsamir on Jan 20 2020, 4:06 PM.

Details

Summary

I wrongly thought QSFPM::setFilterCaseSensitivity() would work when a
QRegularExpression was used, but that method only pertains to QRegExp.
Instead to get case-insensitive filtering set QRegularExpression::CaseInsensitiveOption
on the QRegularExpression object used with setFilterRegularExpression().

Also, thinking about this some more, no need to use QRegularExpression::escape()
with the QuickSelectDialog since only (\w| ) are accepted by the dialog,
everything else is gobbled up by the eventFilter().

Test Plan

make && ctest, all unit tests pass except for:
tests-units-akonadi-akonadistoragetest
tests-units-akonadi-akonadicachingstorageintegrationtest
tests-units-migrator-zanshin021migrationtest
tests-units-migrator-zanshincontextitemsmigrationtest

which fail locally but not on the CI.

Diff Detail

Repository
R4 Zanshin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir requested review of this revision.Jan 20 2020, 4:06 PM
ahmadsamir created this revision.

FTR, there's no way the quickseledctdialogtest could have passed locally; so it looks like I messed/mixed things up with the other diff (KRecursive* port), I must have ran ctest without remember to run make in the build dir when I switched branches, stooopid. Sorry about the trouble.

ahmadsamir updated this revision to Diff 73965.Jan 20 2020, 4:21 PM

Only use QRegularExpression::CaseInsensitiveOption where needed

ervin accepted this revision.Jan 20 2020, 4:38 PM

Thanks!

This revision is now accepted and ready to land.Jan 20 2020, 4:38 PM
This revision was automatically updated to reflect the committed changes.