From 25efd331e82ef49da700bbd567195d80fffb33eb Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Mon, 13 Mar 2006 07:33:30 +0000 Subject: Patch #4791 by Jonathan Gordon - Remove duplicates from the Open-with menu, and allow regular rocks to be loaded as viewers. Also allow all file types in the Open-with menu, not only the registered ones. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9025 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetypes.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'apps/filetypes.c') diff --git a/apps/filetypes.c b/apps/filetypes.c index 4e88f81..0f9f0c7 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -246,6 +246,13 @@ int filetype_load_menu(struct menu_item* menu,int max_items) { if (filetypes[i].plugin) { + int j; + for (j=0;j=0) + { + close(fd); + return plugin_load(plugin_name,file); + } + else + { + snprintf(plugin_name,sizeof(plugin_name),"%s/%s.rock", + PLUGIN_DIR,plugin); + if ((fd = open(plugin_name,O_RDONLY))>=0) + { + close(fd); + return plugin_load(plugin_name,file); + } + } + return PLUGIN_ERROR; } /* get index to filetypes[] from the file attribute */ -- cgit v1.1