From 7e380e9d0cb31349f20d7fb2a5c0f07a2865dd1d Mon Sep 17 00:00:00 2001 From: Aurindam Jana <aurindam.jana@nokia.com> Date: Thu, 23 Feb 2012 17:13:28 +0100 Subject: [PATCH] StackHandler: Set Current Index Set the current Index as 0 (topmost stack frame) when setFrames() is called. Change-Id: Iff0acd672930b51b53ef7ad0335b62d463c14500 Reviewed-by: hjk <qthjk@ovi.com> --- src/plugins/debugger/stackhandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 6a28e4fdc58..04efb34b3ce 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -197,8 +197,10 @@ void StackHandler::setFrames(const StackFrames &frames, bool canExpand) m_contentsValid = true; m_canExpand = canExpand; m_stackFrames = frames; - if (m_currentIndex >= m_stackFrames.size()) - setCurrentIndex(m_stackFrames.size() - 1); + if (m_stackFrames.size() >= 0) + setCurrentIndex(0); + else + m_currentIndex = -1; reset(); emit stackChanged(); } -- GitLab