summaryrefslogtreecommitdiff
path: root/src/plugins/cppcheck/cppchecktool.cpp
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2020-07-13 11:33:34 +0200
committerChristian Stenger <christian.stenger@qt.io>2020-07-13 12:09:04 +0000
commitfeb873ca344c7acb12e407cd930a1163d7abc383 (patch)
tree79a84b02e4c490df95de829f00ab8b88dae6dd34 /src/plugins/cppcheck/cppchecktool.cpp
parent8b26bde4382140dc1281688337355a280d1090a7 (diff)
downloadqt-creator-feb873ca344c7acb12e407cd930a1163d7abc383.tar.gz
CppCheck: Replace QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098 Change-Id: I7b9198f3762f5fa753b5be0e1c0a81abc7f94560 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/cppcheck/cppchecktool.cpp')
-rw-r--r--src/plugins/cppcheck/cppchecktool.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/cppcheck/cppchecktool.cpp b/src/plugins/cppcheck/cppchecktool.cpp
index 492f1b2e25..2c17247d0a 100644
--- a/src/plugins/cppcheck/cppchecktool.cpp
+++ b/src/plugins/cppcheck/cppchecktool.cpp
@@ -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);
});
}