Bug in FileChooser

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in FileChooser

Javier Diaz-Reinoso
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.

Tested in full updated Squeak6.0alpha #17826.

Reply | Threaded
Open this post in threaded view
|

Re: Bug in FileChooser

timrowledge


> On 25-03-2018, at 9:29 AM, Javier Diaz-Reinoso <[hidden email]> 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; [hidden email]; http://www.rowledge.org/tim
It's a damn shame that the irrational orthography of English has lost its rightful place in modern pedagogy.