Mantis - Squeak
Viewing Issue Advanced Details
5851 Kernel feature always 01-29-07 01:58 04-18-10 21:59
Keith_Hodges  
Keith_Hodges  
normal  
closed 3.10  
open  
tweak    
none 3.10.2bc  
0005851: Refactor SmalltalkImage saveAs
Refactor SmalltalkImage-#saveAs to pull out the code that actually saves the image under a new name, into #saveAs: newName

Refactor some other methods that duplicate the use of the same code, to use #saveAs:
child of 0007423new  Fixes included in Level Playing Field 
 SmalltalkImage.1.cs [^] (1,844 bytes) 01-29-07 01:58
 SmalltalkImage.2.cs [^] (2,322 bytes) 02-14-07 12:13
 SmalltalkImage-M5851.3.cs [^] (2,314 bytes) 06-10-08 04:34
 M5851-SmalltalkImage-saveAs.1.cs [^] (2,434 bytes) 12-16-08 18:51

Notes
(0009762)
Keith_Hodges   
02-14-07 12:14   
SmalltalkImage.2.cs ensures that the resuming flag is returned from #saveAs:
(0012290)
matthewf   
06-10-08 04:35   
"fix begin"
Installer mantis bug: 5851 fix: 'SmalltalkImage-M5851.3.cs'.
"fix end"
(0012291)
matthewf   
06-10-08 04:35   
SmalltalkImage-M5851.3.cs removes an underscore assignment
(0012851)
Keith_Hodges   
12-16-08 17:39   
Currently the code doesnt work if the given filename doesnt have .image on the end, perhaps we should ensure that it does, or append it.

Fixed in M5851-SmalltalkImage-saveAs.1.cs

(0013123)
nicolas cellier   
05-11-09 20:54   
Hi Keith, concerning .image extension, I don't think you fixed all the broken code...

For example, you want to save a Squeak3.10.2-7179-basic.image:
Let's debug:
SmalltalkImage current saveAs

From #getFileNameFromUser you enter 'Squeak3.10.2-7179-basic' (remove the .image).
Now you execute
FileDirectory default fileOrDirectoryExists: (self fullNameForImageNamed: newName) -> false
Surprise, (self fullNameForImageNamed: newName) -> Squeak3.10.image

So, you won't save on the image name you did ask for.
And the fix you proposed won't fix this one...
We must either install your workaround also in #getFileNameFromUser
Or maybe we should better fix #fullNameForImageNamed:/#fullNameForChangesNamed:

See 0007351

(0013413)
nicolas cellier   
11-29-09 19:35   
This was superseded by 0007351 in Squeak trunk