forked from qt-creator/qt-creator
ClangTools: Avoid freezing UI for many items
...if new items are added to the model or if filter is used. When items were added, we have called ClangToolsDiagnosticModel::diagnostics() two times: * from DiagnosticFilterModel::filterAcceptsRow() * from ClangTidyClazyTool::handleStateUpdate() However, this does not scale since diagnostics() creates a temporary. Fix this by accessing the diagnostics or the count directly from the tree. Change-Id: I4c6a32e0076c1b4228ed1b1ff9222c9918f92c5c Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -395,7 +395,7 @@ void ClangTidyClazyTool::handleStateUpdate()
|
||||
QTC_ASSERT(m_diagnosticModel, return);
|
||||
QTC_ASSERT(m_diagnosticFilterModel, return);
|
||||
|
||||
const int issuesFound = m_diagnosticModel->diagnostics().count();
|
||||
const int issuesFound = m_diagnosticModel->diagnosticsCount();
|
||||
const int issuesVisible = m_diagnosticFilterModel->rowCount();
|
||||
m_goBack->setEnabled(issuesVisible > 1);
|
||||
m_goNext->setEnabled(issuesVisible > 1);
|
||||
|
||||
Reference in New Issue
Block a user