CppCheck: Replace QRegExp by QRegularExpression

Task-number: QTCREATORBUG-24098
Change-Id: I7b9198f3762f5fa753b5be0e1c0a81abc7f94560
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-07-13 11:33:34 +02:00
parent 8b26bde438
commit feb873ca34
2 changed files with 5 additions and 3 deletions

View File

@@ -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);
});
}