forked from qt-creator/qt-creator
FileSystemFilter: Convert to FuzzyMatcher
Fixes: QTCREATORBUG-18960 Change-Id: I7125362e77d7f079eec0cdcc270438cc98ca9407 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
André Hartmann
parent
857b299356
commit
40921421ae
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user