forked from qt-creator/qt-creator
LSP: Port to QRegularExpression
Task-number: 24098 Change-Id: Ic7efcf3bb3d268e52ac545a72e5188c5affda004 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -370,10 +370,12 @@ bool DocumentFilter::applies(const Utils::FilePath &fileName, const Utils::MimeT
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Utils::optional<QString> _pattern = pattern()) {
|
if (Utils::optional<QString> _pattern = pattern()) {
|
||||||
QRegExp regexp(_pattern.value(),
|
QRegularExpression::PatternOption option;
|
||||||
Utils::HostOsInfo::fileNameCaseSensitivity(),
|
if (Utils::HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive)
|
||||||
QRegExp::Wildcard);
|
option = QRegularExpression::CaseInsensitiveOption;
|
||||||
if (regexp.exactMatch(fileName.toString()))
|
QRegularExpression regexp(QRegularExpression::wildcardToRegularExpression(_pattern.value()),
|
||||||
|
option);
|
||||||
|
if (regexp.match(fileName.toString()).hasMatch())
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Utils::optional<QString> _lang = language()) {
|
if (Utils::optional<QString> _lang = language()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user