Fix state losses for recursive outliner trees (e.g. datablocks editor)
authorSv. Lockal <lockalsash@gmail.com>
Fri, 23 Aug 2013 20:35:00 +0000 (20:35 +0000)
committerSv. Lockal <lockalsash@gmail.com>
Fri, 23 Aug 2013 20:35:00 +0000 (20:35 +0000)
commit52eb61f84b564308762fdaafbd05b5193cf513c0
treebbf0580438614f952605d7adf27f2cadba2396cd
parent587796170a5a307ca82353311097ce845dce175a
Fix state losses for recursive outliner trees (e.g. datablocks editor)

In previous optimization in outliner I assumed that order in treehash was not important.
But testing outliner in datablocks mode revealed a problem: when user expands multiple recursive levels and then closes any element, it always closed the top level of recursion.
Now it should work fine with recursive trees.
Now treehash contains groups of elements indexed by (id,nr,type). Adding an element with the same (id,nr,type) results in appending it to existing group. No duplicates are possible in treehash.
This commit should also make lookups a little bit faster, because searching in small arrays by "used" is faster than searching in hashtable with duplicates by "id,nr,type,used".
source/blender/blenkernel/BKE_treehash.h [new file with mode: 0644]
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/treehash.c [new file with mode: 0644]
source/blender/blenlib/BLI_ghash.h
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/makesdna/DNA_space_types.h