Do not make items invisible when turning off previews
author Frank Reininghaus
committer Frank Reininghaus
commit cc8f5b4939062df44ce0bd314ac4ae04973b9830
tree fdfaafb644364fe37780b3b11e5e9c69ef48f7ff
parent 8f231bd08134f7b1870a9c1747429c1b05174d62
Do not make items invisible when turning off previews

This commit fixes a problem in KItemListView::doLayout(): This function
assumed that firstVisibleIndex is a constant.
However, if the view is scrolled to the bottom with previews enabled,
and then previews are disabled (and the icon size is much smaller
without previews), this function changes the scroll offset, which also
changes the the first visible index. Using the unchanged variable causes
trouble later on (i.e., it makes items which are actually inside the
view area invisible).
lastVisibleIndex is not needed before the scroll offset change and is
const after that, so its calculation is moved a few lines down.
BUG: 291841
FIXED-IN: 4.8.1
REVIEW: 103731