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())
|
if (trimmedPattern.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const QRegExp re(trimmedPattern, Qt::CaseSensitive, QRegExp::Wildcard);
|
const QRegularExpression re(QRegularExpression::wildcardToRegularExpression(trimmedPattern));
|
||||||
if (re.isValid())
|
if (re.isValid())
|
||||||
m_filters.push_back(re);
|
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),
|
std::copy_if(files.cbegin(), files.cend(), std::back_inserter(filtered),
|
||||||
[this](const Utils::FilePath &file) {
|
[this](const Utils::FilePath &file) {
|
||||||
const QString stringed = file.toString();
|
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);
|
return !Utils::contains(m_filters, filter);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ private:
|
|||||||
std::unique_ptr<CppcheckRunner> m_runner;
|
std::unique_ptr<CppcheckRunner> m_runner;
|
||||||
std::unique_ptr<QFutureInterface<void>> m_progress;
|
std::unique_ptr<QFutureInterface<void>> m_progress;
|
||||||
QHash<QString, QString> m_cachedAdditionalArguments;
|
QHash<QString, QString> m_cachedAdditionalArguments;
|
||||||
QVector<QRegExp> m_filters;
|
QVector<QRegularExpression> m_filters;
|
||||||
QRegularExpression m_progressRegexp;
|
QRegularExpression m_progressRegexp;
|
||||||
QRegularExpression m_messageRegexp;
|
QRegularExpression m_messageRegexp;
|
||||||
Utils::Id m_progressId;
|
Utils::Id m_progressId;
|
||||||
|
|||||||
Reference in New Issue
Block a user