Skip to content
Snippets Groups Projects
Commit edbc931e authored by Sven Brauch's avatar Sven Brauch
Browse files

Debugger framestack: Fetch frames until the widget is full

For discussion, see
BUG:316873
parent a00aa6c7
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,9 @@ FramestackWidget::FramestackWidget(IDebugController* controller, QWidget* parent
connect(m_threads, SIGNAL(clicked(QModelIndex)), this, SLOT(setThreadShown(QModelIndex)));
connect(m_frames, SIGNAL(clicked(QModelIndex)),
SLOT(frameClicked(QModelIndex)));
connect(m_frames->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(checkFetchMoreFrames()));
}
FramestackWidget::~FramestackWidget() {}
......@@ -150,9 +153,13 @@ void KDevelop::FramestackWidget::checkFetchMoreFrames()
{
int val = m_frames->verticalScrollBar()->value();
int max = m_frames->verticalScrollBar()->maximum();
const int offset = 20;
int min = m_frames->verticalScrollBar()->minimum();
bool canScroll = min != max;
const int offset = 50;
if (val + offset > max && m_session) {
// Fetch more frames if the user scrolls down far enough,
// or if there's more frames available and the widget is not yet filled.
if ((val + offset > max || ! canScroll) && m_session) {
m_session->frameStackModel()->fetchMoreFrames();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment