[squeak-dev] Bug in FileChooser

tim Rowledge tim at rowledge.org
Sun Mar 25 18:28:02 UTC 2018



> On 25-03-2018, at 9:29 AM, Javier Diaz-Reinoso <javier_diaz_r at mac.com> wrote:
> 
> Create file aaa(2).gcode, then DoIt: 'FileChooser example1', then open aaa(2).gcode, there is an error: 'aaa.gcode does not exist' because now FileChooser try to open aaa.gcode, the problem is in FileList>>fileNameFromFormattedItem: who remove the (2) from the name, why?
> 
> I really don't understand this.

I see what 's happening here; because the FileList is working with a simple list view, the entries are composited from the date, size, name etc and the date is helpfully wrapped in the (). So in order to extract the actual filename from that composite the FileList>>fileNameFromFormattedItem: code is simply scanning for the () in order to use them as position tags. A () in your filename will inevitably confuse this too-simple approach.

The rally sensible approach would be to replace the simple list view with a (much improved, preferably) multi-list view as I use in the new FileChooserDialog and friends. No compositing and so no extracting; simples!

Also we really need a newer cleaner FileList anyway.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
It's a damn shame that the irrational orthography of English has lost its rightful place in modern pedagogy.



More information about the Squeak-dev mailing list