[squeak-dev] Item equality in PluggableTreeMorph
christoph.thiede at student.hpi.uni-potsdam.de
christoph.thiede at student.hpi.uni-potsdam.de
Tue Oct 26 04:59:26 UTC 2021
Hi all!
I am just fixing a bug in the PluggableTreeMorph and was stumbling upon the fact that in #updateFromChangedObject:, items are compared by identity, which makes it harder in the context of a DirectoryChooserDialog to indicate the relevant instance (i.e., you cannot use #containingDirectory which would create a new copy).
Do we actually need identity (#==) instead of equality here? Next to #updateFromChangedObject:, also #getCurrentSelectionItem is using #==. As opposed to this, #selectPath:in: uses #=. Unless you have any counter arguments, I would vote for #= in all three places to delegate equality control to the domain objects that are contained in the tree morph.
Best,
Christoph
---
Sent from Squeak Inbox Talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211026/c378418a/attachment.html>
More information about the Squeak-dev
mailing list
|