This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#5160 - Hide directories that have no useful content
Attached to Project:
Rockbox
Opened by Gabriel de Perthuis (Tobu) - Monday, 17 April 2006, 14:00 GMT+1
Last edited by Jonathan Gordon (jdgordon) - Wednesday, 01 August 2007, 16:08 GMT+1
Opened by Gabriel de Perthuis (Tobu) - Monday, 17 April 2006, 14:00 GMT+1
Last edited by Jonathan Gordon (jdgordon) - Wednesday, 01 August 2007, 16:08 GMT+1
|
DetailsIn modes like music mode, playlist mode or supported files, the file browser can be cluttered with directories that have unrelated content.
The iAudio firmware, when in player mode, hides directories that have no useful content. This includes a few root folders that are created by the firmware, on-the-go apps ( http://portableapps.com/suite plug ) and such. I'd like rockbox to do the same. |
This task depends upon
Closed by Jonathan Gordon (jdgordon)
Wednesday, 01 August 2007, 16:08 GMT+1
Reason for closing: Rejected
Wednesday, 01 August 2007, 16:08 GMT+1
Reason for closing: Rejected
B) Why not just flag those folders as hidden. In the modes that aren't "Show All" files and folders with the hidden attribute are not shown.
A> I think the dircache is the ideal place for that, since it does scan the directory tree at boot and updates it whenever a change occurs.
But it doesn't make it less useful.
If you look at it from a "minimal intrusiveness" point of view (aka maximum reuse, aka maximum laziness), using dircache makes sense.
The patch I'm including:
- is against today's CVS
- has been tested in the simulator only (toolchain not ready yet)
- works with all levels of filtering: all, supported, music, playlists;
- hides directories according to the filter when dircache is enabled;
- should speed up browsing slightly (because file type recognition is moved to boot time)
- should slow down boot time slightly for the same reason
- it doesn't support the dircache's dynamic update hooks yet.
It uses the dynamic update hooks, has been tested on the real thing, and does not visibly impact startup performance (8s to build the dircache with or without, with playback at startup disabled, for ~5000 entries).
The deep filtering is updated when files are created, moved, or copied; removes have no effect (they do not cause their parents to be filtered), but I don't feel it's a really a problem. It could be solved by storing slightly more info (3 ints instead of an enum) in entries.
I'm happy with that patch, and I'd like to propose it for inclusion.
Implementation details:
the patch adds an enum field to every directory entry, which in case of files contains their filter level (as seen in the "show files" selector or the quick menu), and in case of directories contains a filter level which is greater to each of the children's levels. The filtering done in the file list has been changed to just use this field instead of asking the type. The field has the same lifecycle as the rest of the dircache, which means it is dynamically updated whenever files are renamed, moved, and created. The init sequence has been changed so that the type code is initialised before the dircache.