FuzzyMatcher: Improve wildcard matching

Make it equivalent to current wildcard implementation, and replace the
current one with FuzzyMatcher.

Change-Id: If83a4a8dfc7c8930bd92b49972647a519886a831
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2017-10-30 21:48:36 +02:00
committed by Orgad Shaneh
parent 357caf3b44
commit 4300041d24
4 changed files with 5 additions and 35 deletions

View File

@@ -78,10 +78,10 @@ QRegularExpression FuzzyMatcher::createRegExp(
if (!c.isLetter()) {
if (c == question) {
keyRegExp += '.';
plainRegExp += '.';
plainRegExp += ").(";
} else if (c == asterisk) {
keyRegExp += ".*";
plainRegExp += ".*";
plainRegExp += ").*(";
} else {
const QString escaped = QRegularExpression::escape(c);
keyRegExp += '(' + escaped + ')';