]> cloud.milkyroute.net Git - dolphin.git/commit
Make sure that KItemListSizeHintResolver is always consistent
authorFrank Reininghaus <frank78ac@googlemail.com>
Thu, 4 Jul 2013 21:35:01 +0000 (23:35 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Thu, 4 Jul 2013 21:35:01 +0000 (23:35 +0200)
commit786cea007678c3fa086a45392eb6745d54d6e7c4
treef45840051449009f3b3e10b3bf63bae0f9ff72d1
parent508661100fdd41579c7d38a970ab7f495010fb18
Make sure that KItemListSizeHintResolver is always consistent

This was the root cause of bug 317827. The assert tried to make sure
that we never access KItemListSizeHintResolver from
KItemListViewLayouter inside the loop over the item ranges. This would
be dangerous because it might be in an inconsistent state - the removed
item ranges were removed step by step, so accessing the item size hints
before the operation was finished could lead to wrong results.

The solution is to insert/remove all item ranges immediately. A nice
side effect is that there are no sources of O(N^2) complexity in
KItemListSizeHintResolver any more if many item ranges are
inserted/removed.

BUG: 317827
FIXED-IN: 4.11.0
REVIEW: 111382
src/kitemviews/kitemlistview.cpp
src/kitemviews/private/kitemlistsizehintresolver.cpp
src/kitemviews/private/kitemlistsizehintresolver.h