Commit 5f65d796 authored by hjk's avatar hjk Committed by Eike Ziller
Browse files

analyzer: don't crash on "Goto Next Leak" if there is none.

Change-Id: I7829c7c93338fd4238b9148a9fed3be4f5f69687
Reviewed-by: con
Task-number: QTCREATORBUG-5386
Reviewed-on: http://codereview.qt.nokia.com/1427

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent bd92b512
......@@ -509,11 +509,13 @@ void MemcheckErrorView::suppressError()
void MemcheckErrorView::goNext()
{
QTC_ASSERT(rowCount(), return);
setCurrentRow((currentRow() + 1) % rowCount());
}
void MemcheckErrorView::goBack()
{
QTC_ASSERT(rowCount(), return);
const int prevRow = currentRow() - 1;
setCurrentRow(prevRow >= 0 ? prevRow : rowCount() - 1);
}
......
......@@ -544,8 +544,8 @@ void MemcheckTool::updateErrorFilter()
void MemcheckTool::finished()
{
const int n = m_errorModel->rowCount();
m_goBack->setEnabled(n > 0);
m_goNext->setEnabled(n > 0);
m_goBack->setEnabled(n > 1);
m_goNext->setEnabled(n > 1);
const QString msg = AnalyzerManager::msgToolFinished(displayName(), n);
AnalyzerManager::showStatusMessage(msg);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment