From 7fe32b9a27e128e7a674ca24db90cf74d3fa6a54 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon 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 973f60e6e5..77d73df5cc 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