]> cloud.milkyroute.net Git - dolphin.git/commit
Internal KFileItemModel optimizations and cleanups
authorPeter Penz <peter.penz19@gmail.com>
Mon, 31 Oct 2011 18:32:31 +0000 (19:32 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 31 Oct 2011 18:38:02 +0000 (19:38 +0100)
commitd27f776cd2675e67b70556ad4033230435d89d8e
tree6d3c797d23975a72a5b2d055f59b86d6e82b0dc9
parentc872dcbda9b0fbcd945a7917ae9e4b3cb61f347c
Internal KFileItemModel optimizations and cleanups

- Use merge-sort instead of quick-sort. This assures a sane
  worst-case scenario where quick-sort has a runtime complexity of
  O(n*n) (e.g. when changing the sort-order from ascending to
  descending).

- lessThan()-improvements: Change internal data-structures to
  allow a comparison of any role, not only roles available
  in KFileItem

- Don't synchronously move an item if the value has been changed
  of a role defined as sort-role: This is too expensive in case if
  e.g. the sorting is done by "type" and the type is determined
  step by step.
src/kitemviews/kfileitemmodel.cpp
src/kitemviews/kfileitemmodel.h
src/tests/kfileitemmodeltest.cpp