MVC-Morphic refactoring, review needed (was: [squeak-dev] The Trunk: System-dtl.170.mcz)

David T. Lewis lewis at mail.msen.com
Sun Nov 22 23:21:22 UTC 2009


I updated Project>>okToChange to remove Morphic/MVC dependencies. In the
process I elimated some logic that appears to serve no purpose. However,
this is code that existed in earlier versions of the method with a "di"
author stamp, so I am concerned that it may have been there for a reason
that I don't understand. If someone can review the change, I'd appreciate it.

Brief explanation: Project>>okToChange is called when the window representing
a project is being deleted. The sender may be a SystemWindow (Morphic) or
a ProjectController (MVC), and the project to be deleted may be an MVCProject
of a MorphicProject. The original code does this:

	ok := world isMorph not and: [world scheduledControllers size <= 1].
	ok ifFalse: [self isMorphic ifTrue:
		[self parent == CurrentProject 
			ifFalse: [^ true]]].  "view from elsewhere.  just delete it."


I could find no path through the code for which this did anything useful,
so I changed it to this:

	self parent == CurrentProject 
			ifFalse: [^ true].  "view from elsewhere.  just delete it."

Hopefully this was just leftover cruft that needed cleaning. Am I missing anything?

Thanks,
Dave




More information about the Squeak-dev mailing list