[squeak-dev] The Trunk: ToolBuilder-Morphic-cmm.210.mcz

Chris Muller asqueaker at gmail.com
Sun Apr 8 00:17:52 UTC 2018


Fixed by ToolBuilder-Morphic-cmm.211.mcz.

On Sat, Apr 7, 2018 at 5:22 PM, tim Rowledge <tim at rowledge.org> wrote:
>
>
>> On 07-04-2018, at 1:55 PM, commits at source.squeak.org wrote:
>>
>> Chris Muller uploaded a new version of ToolBuilder-Morphic to project The Trunk:
>> http://source.squeak.org/trunk/ToolBuilder-Morphic-cmm.210.mcz
>>
>>
>> +                                                     [ suffixList isEmpty or:
>> +                                                             [ UIManager default inform: 'WARNING:  File not saved!!  A filename matching one of ' , patternList asArray asString , ' patterns is required.'.
>> +                                                             false ] ] ] ]!
>> -                                                     [ fileName := nil.
>> -                                                     UIManager default inform: 'WARNING:  File not saved!!  A filename matching one of ' , patternList asArray asString , ' patterns is required.'.
>> -                                                     false ] ] ]!
>>
>
> That's something of an improvement but I think we've stumbled on a logic problem with this.
>
> When an initial filename is specified (FileSaverDialog>>#initialFilename:) the suffix of that filename is used for an initial member of the suffixList. That may be good, or may not be - not entirely sure.
>
> Later, your code change appends the first member of the suffixList to the chosen filename, even if the chosen filename might already have that suffix. This at least explains why my attempts to save my badly named 'foo.image.image' image file as plain old 'foo.image' won't work!
>
> I'm honestly not entirely sure what my intent was when I made the default suffix be derived from the initial filename (I failed to comment adequately!) but combined with code being 'helpful' by adding a suffix it doesn't quite do the right thing. We *could* make the filename absent the suffix but then all the places where we check against existing filenames would need work. We could check the selected filename against all the suffices (which we do already in FileSaverDialog>>#selectFilename:) before adding a best-guess suffix. Or something else?
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> It is easier to change the specification to fit the program than vice versa.
>
>
>


More information about the Squeak-dev mailing list