[Cuis-dev] FlatFileList

Mariano Montone marianomontone at gmail.com
Sun May 8 06:07:28 PDT 2022


Hi Luciano,

El 8/5/22 a las 04:00, Luciano Notarfrancesco escribió:
> Hi Mariano,
>
> Do you know why exactly the original file list was slow and why this 
> is faster? Can we improve the performance of the current file list or 
> the HierarchicalListMorph in general?

I have not strictly measured, so I'm not sure if the problem is the 
widget or the disk access, or a bit of both. Also, I've noticed that my 
flat file browser is a bit slower for some of my directories than 
others. I guess it has to do with directory size.

Also, my machine is quite slow, and with a quite deep file structure;  
perhaps not everybody has this problem.

> And why did you find the need to subclass InnerListMorph and 
> PluggableListMorph and add the instance variable itemPrinter? 
> Originally PluggableListMorph is designed to get a list of strings 
> from the model, and on selection it tells the model the selected index 
> in the list. It seems that so far we didn’t have the need to allow 
> arbitrary objects in the lists and using just strings was enough. I 
> wonder if we can do the same here, and otherwise if we should make the 
> PluggableListMorph “even more pluggable” by allowing arbitrary objects 
> as items and avoid adding those two special subclasses with itemPrinting.

Yes. I've done this many times. I really, really want to work with the 
underlying objects, not the strings. For example, the flat file browser 
displays only the name of the file entries, not the full path. Also, I'm 
considering using something like <filename> - <date> - <size> .. I 
wouldn't want to have to parse FileEntries back from those string 
representations..

Now that I think about it, I could use PluggableListMorph with some 
ItemWrapper with the custom printing, instead of subclassing the list 
morph, but still, it would be another inconvenience having to wrap/unwrap.

I have an extension of PluggableListMorph in another package that 
supports both itemPrinting and icons. I often use that in my projects; 
not this time, as I didn't want to introduce a package dependency.

So, yes, making PluggableListMorph more pluggable would be something 
worth considering IMO.

Cheers,

Mariano

>
>
> On Sun, 8 May 2022 at 8:52 AM Mariano Montone via Cuis-dev 
> <cuis-dev at lists.cuis.st> wrote:
>
>     Hello,
>
>     I've started a FlatFileList tool, a file browser that uses a flat
>     directory list instead of a directory tree as the default Cuis file
>     browser does.
>
>     https://bitbucket.org/mmontone/mold/raw/master/FlatFileList.pck.st
>
>     Open via world menu: "open" -> "Flat File List".
>
>     Use double click to open a directory, and visualize files.
>
>     Right click for changing sort order, and file specific functions
>     (file
>     in, install, etc).
>
>     You can also enter a directory path directly in the text input on the
>     upper-left.
>
>     It is very incomplete and haven't decided on its final form yet,
>     but ..
>     it is very fast and useful already for loading code.
>
>     Also, I hope that a file selection tool comes out of this too, as I
>     think that'd be useful for other Cuis applications.
>
>     If you want to take a peek and give me some feedback, that's welcomed.
>
>     Cheers,
>
>     Mariano
>
>
>     -- 
>     Cuis-dev mailing list
>     Cuis-dev at lists.cuis.st
>     https://lists.cuis.st/mailman/listinfo/cuis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220508/a174c4b3/attachment-0001.htm>


More information about the Cuis-dev mailing list