diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/cppcheck/cppchecktool.cpp | 6 | ||||
| -rw-r--r-- | src/plugins/cppcheck/cppchecktool.h | 2 |
2 files changed, 5 insertions, 3 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); }); } diff --git a/src/plugins/cppcheck/cppchecktool.h b/src/plugins/cppcheck/cppchecktool.h index abce347fbf..cc5f77d218 100644 --- a/src/plugins/cppcheck/cppchecktool.h +++ b/src/plugins/cppcheck/cppchecktool.h @@ -84,7 +84,7 @@ private: std::unique_ptr<CppcheckRunner> m_runner; std::unique_ptr<QFutureInterface<void>> m_progress; QHash<QString, QString> m_cachedAdditionalArguments; - QVector<QRegExp> m_filters; + QVector<QRegularExpression> m_filters; QRegularExpression m_progressRegexp; QRegularExpression m_messageRegexp; Utils::Id m_progressId; |
