Hi,

Here is a new NSOutlineView patch that implements the lazy loading of the outline items. Until now NSOutlineView entered in an endless recursion on browsing a file system or a not-so-small object graph (by trying to create outline items for all the files for example). This patch modifies _loadDictionaryStartingWith: to only load expanded items. _openItem: has been updated to check whether the item needs to be loaded (or reloaded) before retrieving the children of the item and inserting them as cells. If the children haven't been loaded, - _loadDictionaryStartingWith: will be called for the given item which is getting expanded/open.
This patch is based on Cocoa behavior.
As a side note, I found this code a bit hard to read, for example having better names for variables rather than item, sitem, startitem could help. However I don't know which names could work better :-/

Attachment: NSOutlineView.m.patch
Description: Binary data




Cheers,
Quentin.
_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to