Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Plugins
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by fml2 - 2007-08-27
Last edited by petur - 2007-09-03

FS#7667 - Split shortcuts plugin into a viewer and an appender

This simplifies code, we don’t have to analyse whether it’s a .link file etc – each part has its own little task.

Also, two options are introduced:

1. In the link file, you can specify the display name for the entry. It should be separated from the path by the TAB. E.g.

/my/path/<TAB>My favourite songs

2. In the file, you can write

#Display last path segments=N

and then only the last N path segments will be displayed. This is handy if your music is in a deep folder.

Explicit name (with a TAB) has higher priority than N, i.e. if N=2 and you have

/aa/bb/cc/x.mp3<TAB>YYY

then the item will be displayed as YYY and not as bb/cc/x.mp3

I get some strange linker errors. Before I split the plugin into two everything worked OK.

Closed by  petur
2007-09-03 22:25
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

I did find two tabs and a too long line :p

fml2 commented on 2007-08-28 15:26

Please somebody help me with the makefile. There are three source .c files in plugins/shortcuts: shortcuts_common.c, shortcuts_view.c, and shortcuts_append.c (and one .h file)

Out of these three files, two .rocks should be produced:
1. shortcuts_common.c + shortcuts_view.c → shortcuts_view.rock
2. shortcuts_common.c + shortcuts_append.c → shortcuts_append.rock

How can this be done?

I somehow managed to produce a patch file with duplicated patches. Attached is the corrected patch.

fml2 commented on 2007-08-28 22:19

Now everything gets compiled and linked (many thanks to linuxstb). Viewer works. But the appender doesn’t get loaded. On the sim, I get error message “Incompatible version”. And have no idea about the reason. Linking problem?

fml2 commented on 2007-08-29 18:56

Now everything works. Thanks go to linuxstb again for spotting the problem in shortcuts_append.c. This could be committed if you ask me. Feedback is welcome.

petur commented on 2007-08-30 19:25

I can understand most of your changes, except splitting the plugin in two… It wasn’t that big and complicated, was it?

fml2 commented on 2007-08-30 20:08

Now everything works as in the original, i.e. selecting a file entry places the cursor at the file in the file browser. Selecting a dir entry enters that dir and places the cursor at the first file inside it.

Since I was one of the initiators for the creation of the plugin and am one of its very few users (if not the only one :-) could you please commit it asap.

@petur: after the splitting, each part has its own little but well defined task. Before splitting, if you selected a .link file and wanted to add it to the shortcuts, it was shown instead → not the principle of the least surprise IMHO. Another thing was that the association of the plugin with .link files was hard coded in the plugin. IMHO it should be done in viewers.config only.

fml2 commented on 2007-08-30 20:34

Corrected patch. Now we correctly determine if it’s a file or a dir (sim and target behave differently when calling open()).

petur commented on 2007-08-30 21:22

some remarks:
1) the opening braces of a function should be on a new line (this is not yet in CONTRIBUTING but it will be soon)
2) I do not understand how the shortcuts to shortcuts works. With your patch you can add it but afterwards it doesn’t look like you can do much with it (I thought it would open the shortcut file)

fml2 commented on 2007-08-31 06:58

to 1) I’ll correct this (are there tools to do that automatically?)

to 2) Shortcuts are just a way to quickly go to a certaint dir/file. It doesn’t dictate what you should do with it then, just takes you there in the file browser. Just a shortcut. It doesn’t “play” the file. So you could put a reference to a link file into another link file and quickly jump from dir to dir :-)

petur commented on 2007-08-31 18:06

there were not that many {} violations, I did it here in order to test and it took < 5m ;)

thanks for clarifying 2)

fml2 commented on 2007-08-31 21:49

Some further modifications:

1. Corrected braces
2. Removed malloc, work with an array instead
3. After deleting an entry, stay in the list
4. If an item with no more existing path/file is selected, display a splash but stay in the list
5. Properly handle connecting to USB

fml2 commented on 2007-08-31 21:58

Slightly better behaviour after deleting an entry: if it was the last entry, exit the plugin.

fml2 commented on 2007-08-31 21:59

Ah, wrong button clicked! Now with the patch.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing