forked from qt-creator/qt-creator
CppCheck: Replace QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098 Change-Id: I7b9198f3762f5fa753b5be0e1c0a81abc7f94560 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -67,7 +67,7 @@ void CppcheckTool::updateOptions(const CppcheckOptions &options)
|
||||
if (trimmedPattern.isEmpty())
|
||||
continue;
|
||||
|
||||
const QRegExp re(trimmedPattern, Qt::CaseSensitive, QRegExp::Wildcard);
|
||||
const QRegularExpression re(QRegularExpression::wildcardToRegularExpression(trimmedPattern));
|
||||
if (re.isValid())
|
||||
m_filters.push_back(re);
|
||||
}
|
||||
@@ -192,7 +192,9 @@ void CppcheckTool::check(const Utils::FilePaths &files)
|
||||
std::copy_if(files.cbegin(), files.cend(), std::back_inserter(filtered),
|
||||
[this](const Utils::FilePath &file) {
|
||||
const QString stringed = file.toString();
|
||||
const auto filter = [stringed](const QRegExp &re) {return re.exactMatch(stringed);};
|
||||
const auto filter = [stringed](const QRegularExpression &re) {
|
||||
return re.match(stringed).hasMatch();
|
||||
};
|
||||
return !Utils::contains(m_filters, filter);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user