diff options
author | William Wilgus <wilgus.william@gmail.com> | 2021-03-07 10:07:49 -0500 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2021-03-07 10:07:49 -0500 |
commit | 9712d375ce31d8394cc30b9121577a7646c1af12 (patch) | |
tree | 15496f9654ae0fbeecb50017d48b34f2f6463216 /apps/shortcuts.c | |
parent | 0dce97372987a0b25446c33c7bfd616780d9d7c0 (diff) |
Shortcuts.c -- Update
Fix returns from shortcuts -- should now run plugins
Fix formatting of file names to remove path from browser shortcuts
Change-Id: I46e337110d04b84bedcb0c2945d5dd29a1860847
Diffstat (limited to 'apps/shortcuts.c')
-rw-r--r-- | apps/shortcuts.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/shortcuts.c b/apps/shortcuts.c index aa9a32bbb2..70f140d42e 100644 --- a/apps/shortcuts.c +++ b/apps/shortcuts.c @@ -395,8 +395,6 @@ static const char * shortcut_menu_get_name(int selected_item, void * data, char * buffer, size_t buffer_len) { (void)data; - (void)buffer; - (void)buffer_len; struct shortcut *sc = get_shortcut(selected_item); if (!sc) return ""; @@ -409,6 +407,16 @@ static const char * shortcut_menu_get_name(int selected_item, void * data, /* No translation support as only soft_shutdown has LANG_SHUTDOWN defined */ return type_strings[SHORTCUT_SHUTDOWN]; } + else if (sc->type == SHORTCUT_BROWSER && (sc->u.path)[0] != '\0') + { + char* pos; + if (path_basename(sc->u.path, (const char **)&pos) > 0) + { + if (snprintf(buffer, buffer_len, "%s (%s)", pos, sc->u.path) < (int)buffer_len) + return buffer; + } + } + return sc->name[0] ? sc->name : sc->u.path; } @@ -609,7 +617,6 @@ int do_shortcut_menu(void *ignored) /* else fall through */ case SHORTCUT_BROWSER: { - if(open_plugin_add_path(ID2P(LANG_SHORTCUTS), sc->u.path, NULL) != 0) { done = GO_TO_PLUGIN; |