[Cuis-dev] Small refactors to remove duplicated code in Browser
Facundo Javier Gelatti
javiergelatti at gmail.com
Tue Apr 7 13:19:05 PDT 2026
Hi!
I attach two independent changes.
A first one to remove some duplicated code for #defineClass:notifying: in
Browser and HierarchyBrowser (I extracted a new message to be able to just
add the difference).
A second one, to remove the duplication in #removeMessageCategory in
Browser and CodeFileBrowser, but which I'm not sure about and needs more
explanation (which is below).
The differences in #removeMessageCategory in Browser and CodeFileBrowser
are:
- that Browser *always* sends changed: #messageCategoryList (which I
guess is harmless?), and
- CodeFileBrowser *does not* send changed: #classSelectionChanged.
But if we check the senders of #classSelectionChanged, we see it's only
used in the context of #changed:, but no object seems to be listening to
that change. If that's the case, then we can remove all usages
of #classSelectionChanged and then remove the
CodeFileBrowser>>#removeMessageCategory method (so CodeFileBrowser inherits
the one from Browser). And that's what's done in the second change set.
Cheers!
Facu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260407/46c64a5f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove_duplicated_code_between_Browser_and_HierarchyBrowser-FJG.001.cs.st
Type: application/vnd.sailingtracker.track
Size: 2135 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260407/46c64a5f/attachment-0002.st>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove_usages_of_classSelectionChanged_and_make_CodeFileBrowser_inherit_removeMessageCategory-FJG.001.cs.st
Type: application/vnd.sailingtracker.track
Size: 3737 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260407/46c64a5f/attachment-0003.st>
More information about the Cuis-dev
mailing list