New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prevent duplicate QSObjects #2231
Conversation
what the... how is that even possible?! I knew Cocoa uses hashes (much like Python) to compare objects, but can't believe it was never set. Crazy! One thing:
And... what the hell: can of worms! Why is there a protocol called |
Good point. I’ve changed it to use
That all makes sense to me. But I must admit I’ve never understood the purpose of |
The answer to that question will of course pre-date version control. Do you have a minute to weigh in @alcor? |
I think it may have been to enable things like QSNullObject as placeholders in arrays for sorting and searching, it was also to allow other non-QSObject things to exist should they need to. Since it doesn't appear to be widely used, there may be more effective ways of doing the same things. |
Now that I’m pretty sure we’ve actually fixed issues with duplicates, we can remove that |
Looks good, although I'm getting two test failures running this locally:
|
Yeah, I thought I would fix The test is probably set up wrong. I don’t think it’s possible to have two different objects with the same identifier (especially after that last commit). So maybe No idea what’s up with file naming. I’ll look into it. |
This should prevent NSSets from containing duplicates. fixes #2097
identifier can potentially be nil - stringValue shouldn't be
Rebased this to make sure tests are happy. |
This was included in the 1.5.0 dev preview and no issues have been reported. Merging. |
RTFM FTW!
This should fix the problems we’ve seen with duplicates in the third pane (#2097) and God knows how many other places.
This is also, I’m sure, the true fix for #1459. I remember you were trying to clean up the way identifiers were managed at the time @pjrobertson and we had to revert the changes, but could never figure out why. We can probably re-implement those changes now (once I figure out what they were).