gnustep / libs-gui

The GNUstep gui library is a library of graphical user interface classes written completely in the Objective-C language; the classes are based upon Apple's Cocoa framework (which came from the OpenStep specification). *** Larger patches require copyright assignment to FSF. please file bugs here. ***
http://www.gnustep.org
GNU General Public License v3.0
279 stars 103 forks source link

NSOutlineView root item vs. nil #306

Open rmottola opened 1 month ago

rmottola commented 1 month ago

The root item of an OutlineView is expected to be nil. GNUmail (check MailboxManagerController.m reloadAllFolders) calls directly with the root item (in that case an array). Apple apparently deduplicates and works, while GNUstep will descend and expand first nil to the array and then put the array as first level item. Apple somehow "notices" they are the same. [NSOutlineView expandItem]

gcasa commented 1 month ago

outlineViewLazyLoad

Here it calls the outlineView data source method with a different method than we do. We use expandItem: nil, they use _nonStaticDataSourceChild:ofItem:. While our implementation is functionally correct, and conforms to the documentation, this results in slightly different behavior. Also, I believe as mentioned above, Apple is deduplicating items per child, so they are only displayed once. Also see below... the data source is called with item = nil...

outlineViewLazyLoad2

rmottola commented 1 month ago

I think we need to write a test if the duplication is being done per-item or only at the root level.

gcasa commented 1 month ago

Tested our theory... SameStringTest It appears it is not deduplicated. I think what we have is good enough.