Do not try to smooth-scroll past the end of the view

Review Request #111557 - Created July 18, 2013 and submitted

Information
Frank Reininghaus
kde-baseapps
KDE/4.11
322212
Reviewers
dolphin
KItemListSmoothScroller::scrollTo(qreal position) does not check if 'position' is a valid value. Even if the view is scrolled to the bottom already, it tries to scroll further and activates "smooth scrolling" when the mouse wheel is used. Because it never gets out of the "smooth scrolling" state then, it gets confused when changing the directory, and restoring the correct scroll offset may fail.

Can be fixed easily by making sure that 'position' is in the valid range before initiating the smooth scrolling.
Fixes the bug for me, and does not seem to cause any new problems so far.
Emmanuel Pescosta
Emmanuel Pescosta
Commit Hook
Frank Reininghaus
Review request changed

Status: Closed (submitted)

Loading...