ClangTools: Do not show text marks for suppressed diagnostics

Do not generate marks for automatic runs
and hide them for the explicitly invoked analyzes.

Change-Id: Ic48e7b13c424c51e7e1759c588c94bbd45e6d1bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-10-01 14:39:21 +02:00
parent 43facbe090
commit d7ab6210af
4 changed files with 32 additions and 3 deletions

View File

@@ -629,8 +629,10 @@ bool DiagnosticFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
const Diagnostic &diag = diagnosticItem->diagnostic();
// Filtered out?
if (m_filterOptions && !m_filterOptions->checks.contains(diag.name))
if (m_filterOptions && !m_filterOptions->checks.contains(diag.name)) {
diagnosticItem->textMark()->setVisible(false);
return false;
}
// Explicitly suppressed?
foreach (const SuppressedDiagnostic &d, m_suppressedDiagnostics) {
@@ -640,10 +642,12 @@ bool DiagnosticFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
QFileInfo fi(filePath);
if (fi.isRelative())
filePath = m_lastProjectDirectory.toString() + QLatin1Char('/') + filePath;
if (filePath == diag.location.filePath)
if (filePath == diag.location.filePath) {
diagnosticItem->textMark()->setVisible(false);
return false;
}
}
diagnosticItem->textMark()->setVisible(true);
return true;
}