forked from qt-creator/qt-creator
CppTools: Allow filtering issues with line edit
...matching diagnostic text/description. Child items are excluded. Change-Id: Ie7c50af59e0836f60b2ca3bbe50b11eb19398c61 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -346,8 +346,11 @@ void DiagnosticFilterModel::addSuppressedDiagnostic(
|
||||
bool DiagnosticFilterModel::filterAcceptsRow(int sourceRow,
|
||||
const QModelIndex &sourceParent) const
|
||||
{
|
||||
// Avoid filtering child diagnostics / explaining steps.
|
||||
if (sourceParent.isValid())
|
||||
return true;
|
||||
|
||||
// Is the diagnostic suppressed?
|
||||
const Diagnostic diag = static_cast<ClangToolsDiagnosticModel *>(sourceModel())
|
||||
->diagnostics().at(sourceRow);
|
||||
foreach (const SuppressedDiagnostic &d, m_suppressedDiagnostics) {
|
||||
@@ -360,7 +363,12 @@ bool DiagnosticFilterModel::filterAcceptsRow(int sourceRow,
|
||||
if (filePath == diag.location.filePath)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
// Does the diagnostic match the filter?
|
||||
if (diag.description.contains(filterRegExp()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void DiagnosticFilterModel::handleSuppressedDiagnosticsChanged()
|
||||
|
||||
Reference in New Issue
Block a user