From 2d63632e09f61e26974378ba40c2831aa6d9288c Mon Sep 17 00:00:00 2001 From: jdgordon Date: Mon, 6 Aug 2007 13:58:16 +0000 Subject: [PATCH] Only show plugins which are actually associated with the file from the "open with" menu. (plugins registered with * in the viewers.config are always shown) Shows everything if the file doesnt have a extension. Also fix the plugin name showing the whole path instead of just the name. Previous commit should have said "Delete your current /.rockbox/rocks folder because the plugins' config/extra files have moved and to save you hassles" git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14215 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetypes.c | 15 +++++++++++++-- apps/plugins/viewers.config | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/filetypes.c b/apps/filetypes.c index 973f60e6e..77d73df5c 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -424,10 +424,14 @@ int filetype_list_viewers(const char* current_file) { int i, count = 0; char *strings[MAX_FILETYPES/2]; + char *ext; struct menu_callback_with_desc cb_and_desc = { NULL, ID2P(LANG_ONPLAY_OPEN_WITH), Icon_Plugin }; struct menu_item_ex menu; + ext = strrchr(current_file, '.'); + if (ext) + ext++; for (i=0; i