forked from qt-creator/qt-creator
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: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -509,11 +509,13 @@ void MemcheckErrorView::suppressError()
|
|||||||
|
|
||||||
void MemcheckErrorView::goNext()
|
void MemcheckErrorView::goNext()
|
||||||
{
|
{
|
||||||
|
QTC_ASSERT(rowCount(), return);
|
||||||
setCurrentRow((currentRow() + 1) % rowCount());
|
setCurrentRow((currentRow() + 1) % rowCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemcheckErrorView::goBack()
|
void MemcheckErrorView::goBack()
|
||||||
{
|
{
|
||||||
|
QTC_ASSERT(rowCount(), return);
|
||||||
const int prevRow = currentRow() - 1;
|
const int prevRow = currentRow() - 1;
|
||||||
setCurrentRow(prevRow >= 0 ? prevRow : rowCount() - 1);
|
setCurrentRow(prevRow >= 0 ? prevRow : rowCount() - 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -544,8 +544,8 @@ void MemcheckTool::updateErrorFilter()
|
|||||||
void MemcheckTool::finished()
|
void MemcheckTool::finished()
|
||||||
{
|
{
|
||||||
const int n = m_errorModel->rowCount();
|
const int n = m_errorModel->rowCount();
|
||||||
m_goBack->setEnabled(n > 0);
|
m_goBack->setEnabled(n > 1);
|
||||||
m_goNext->setEnabled(n > 0);
|
m_goNext->setEnabled(n > 1);
|
||||||
const QString msg = AnalyzerManager::msgToolFinished(displayName(), n);
|
const QString msg = AnalyzerManager::msgToolFinished(displayName(), n);
|
||||||
AnalyzerManager::showStatusMessage(msg);
|
AnalyzerManager::showStatusMessage(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user