This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#8637 - make disktidy files configurable
Attached to Project:
Rockbox
Opened by Vuong Minh Hiep (vmh) - Sunday, 24 February 2008, 21:17 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Sunday, 18 May 2008, 09:27 GMT+2
Opened by Vuong Minh Hiep (vmh) - Sunday, 24 February 2008, 21:17 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Sunday, 18 May 2008, 09:27 GMT+2
|
DetailsThis patch makes disktidy plugin read the files/directories to clean from a configuration file.
|
This task depends upon
Closed by Jonathan Gordon (jdgordon)
Sunday, 18 May 2008, 09:27 GMT+2
Reason for closing: Accepted
Additional comments about closing: any volanteers to fix the manual?
Sunday, 18 May 2008, 09:27 GMT+2
Reason for closing: Accepted
Additional comments about closing: any volanteers to fix the manual?
- clean up
- move configuration file into the patch file
In your case, you can just add the following lines into the 'disktidy.cfg' file:
<Linux>
.Trash/
Here are some explanations:
- directories are marked with an ending '/' (I assume .Trash is a directory)
- all the entries have wildcards (e.g. '.Trash' has the meaning of '.Trash*')
disktidy will create a sample cfg file if none can be found. This way the cfg doesn't need to be included in the standard build and the user's cfg file won't get overwritten on every update.
* Now follows the coding guidelines better
* Added the Linux introduced r17210 (and .Trash-username)
Use explicit Wildcards (*) instead of implicit ones.
To delete all files of the type "._random.bla" you have to add "._*" to the config file. Same goes for directories. In order to delete all gnome trash dirs add ".Trash*/".
Updated build in config file to use explicit wildcards.
so, this patch is against svn, although I really like your wildcard matching so that should get dumped into this...
disctidy is now a viewer for .dtdy files which are in the format <string>: <yes/no> where string is the filename or directory (or special type where it starts with a <). if its a directory it needs to end in /
yes/no means it should be removed.
the "Files to Clean" item now opens up a list of all the types from either the hard coded defaults, or the .dtdy. selecting any will toggle it (I've used the cursor icon, but not sure thats the best one).
choosing < ALL > selects all, < NONE > selects none. any of the other special ones toggles all the items untill the next header.
to exit that screen press the usual list cancel button (left arrow/previous on 99% of targets)
if that screen is changed at all you will be prompted to save the changes before exiting...
thoughts?
Some remarks:
- I don't have a MAC but without wildcard a file with the name ._ makes no sense.
- Default should be <All> selected, not none (I don't think an ordinary user want to fuss about configuration)
- Don't like it as a "viewer"
- viewer.config is missing in your patch
- What's the purpose of <Other>?
- debatable
- why?
- its the first hunk of the patch
- to put other files under
Further suggestions:
* Add a trailing "/" to directories in the "Files To Clean" menu
* Select all files by default (done in this patch too)
* Add icon infront of the < OS > items (maybe the folder one as you suggested)
it never does anything automatically, the viewer part is just to load the defaults, having it show up in the open with menu isnt great, but unless we add a way to exclude plugins from that I think its fine.
this attached patch removes the viewer part and adds Desktop.ini
I think all files should default to being removed
I've just patched with the last 'viewer-enabled' version (disktidy_2.patch) and I think the UI for selecting the required files is excellent. Bring back the viewer!
The only bit I don't understand is how to have *my* hand-crafted *.dtdy file used as the default. I can browse to the file and 'play' it, thus starting disktidy with my settings present. However, this is in /.rockbox and therefore not intended to be browsed to by users. If I just start disktidy from the [Main] > Plugins > Applications menu, is uses the hard-coded defaults...
Or were you referring to Vuong Minh's comment about not being able to configure it at all now...?
1) it means that you could have different setups for different OS' (although I've changed my mind and thihng thats pointless now)
2) so we can hardcode a default list which would stay updated in new builds, and would not overwrite users' setups (the alternative was disktidy.conf and disktidy_user.conf, which may be better anyway)
this one loads disktidy.config (which will be part of the zip, and have every item set to not be removed), then it loads disktidy_custom.config which will add and overwrite the first config. (this way when the default one is updated the user will definatly get the new types)
any volanteers for the manual/wiki fixing?
* Show the tailing slashes for directories that the user knows what a dir is and what not (made sure it doesn't save with two slashes in the end :-P)
* Some changes to the config file (one entry was a dir and one was not, added $RECYCLE.BIN/ and desktop.ini)
While adding the 2 new entries i noticed that they didn't show up in the menu. I like the idea however. Maybe it's easier to implement it this way that if disktidy_custom.config doesn't exist create an empty file. When the user adds stuff to it show it under the < Other > section.
also fixed the problem with new files not being added (the actual problem was the 2nd file was overwriting the first)..
the last thing that I think is needed is for the files from the user config get merged into the defaults, not just appended which is happening now (i mean, < Windows > items from the user one should be put in the < Windows > group.
any takers?
items from _custom are inserted into the correct groups
Haven't got time to try the latest version, but will do soon.