FileSystemFilter: Convert to FuzzyMatcher

Fixes: QTCREATORBUG-18960
Change-Id: I7125362e77d7f079eec0cdcc270438cc98ca9407
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Andre Hartmann
2019-07-14 08:10:50 +02:00
committed by André Hartmann
parent 857b299356
commit 40921421ae
5 changed files with 63 additions and 37 deletions

View File

@@ -122,6 +122,21 @@ QRegularExpression FuzzyMatcher::createRegExp(
return QRegularExpression('(' + plainRegExp + ")|" + keyRegExp);
}
/**
\overload
This overload eases the construction of a fuzzy regexp from a given
Qt::CaseSensitivity.
*/
QRegularExpression FuzzyMatcher::createRegExp(const QString &pattern,
Qt::CaseSensitivity caseSensitivity)
{
const CaseSensitivity sensitivity = (caseSensitivity == Qt::CaseSensitive)
? CaseSensitivity::CaseSensitive
: CaseSensitivity::CaseInsensitive;
return createRegExp(pattern, sensitivity);
}
/*!
* \brief Returns a list of matched character positions and their matched lengths for the
* given regular expression \a match.