forked from qt-creator/qt-creator
Fix a crash when changing filter for clazy analyzer
Fixes: QTCREATORBUG-24935 Change-Id: I94ff4f1a5bdd07c8055608048773b4a81a81fcb3 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -313,6 +313,12 @@ DiagnosticItem::~DiagnosticItem()
|
||||
delete m_mark;
|
||||
}
|
||||
|
||||
void DiagnosticItem::setTextMarkVisible(bool visible)
|
||||
{
|
||||
if (m_mark)
|
||||
m_mark->setVisible(visible);
|
||||
}
|
||||
|
||||
Qt::ItemFlags DiagnosticItem::flags(int column) const
|
||||
{
|
||||
const Qt::ItemFlags itemFlags = TreeItem::flags(column);
|
||||
@@ -630,7 +636,7 @@ bool DiagnosticFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
|
||||
|
||||
// Filtered out?
|
||||
if (m_filterOptions && !m_filterOptions->checks.contains(diag.name)) {
|
||||
diagnosticItem->textMark()->setVisible(false);
|
||||
diagnosticItem->setTextMarkVisible(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -643,11 +649,11 @@ bool DiagnosticFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
|
||||
if (fi.isRelative())
|
||||
filePath = m_lastProjectDirectory.toString() + QLatin1Char('/') + filePath;
|
||||
if (filePath == diag.location.filePath) {
|
||||
diagnosticItem->textMark()->setVisible(false);
|
||||
diagnosticItem->setTextMarkVisible(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
diagnosticItem->textMark()->setVisible(true);
|
||||
diagnosticItem->setTextMarkVisible(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user