Fix the open with menu

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14241 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-08-08 10:02:00 +00:00
parent 92abed78cc
commit ecae04a9f2

View file

@ -448,7 +448,8 @@ int filetype_list_viewers(const char* current_file)
int j; int j;
for (j=0;j<count;j++) /* check if the plugin is in the list yet */ for (j=0;j<count;j++) /* check if the plugin is in the list yet */
{ {
if (items[j] == i) if (filetypes[i].plugin &&
!strcmp(filetypes[i].plugin,filetypes[items[j]].plugin))
break; break;
} }
if (j<count) if (j<count)
@ -479,9 +480,11 @@ int filetype_list_viewers(const char* current_file)
continue; continue;
else if (action == ACTION_STD_OK) else if (action == ACTION_STD_OK)
{ {
i = gui_synclist_get_sel_pos(&lists); char plugin[MAX_PATH];
return filetype_load_plugin(filetypes[i].plugin, i = items[gui_synclist_get_sel_pos(&lists)];
(void*)current_file); snprintf(plugin, MAX_PATH, "%s/%s.%s",
PLUGIN_DIR, filetypes[i].plugin, ROCK_EXTENSION);
return plugin_load(plugin, (char*)current_file);
} }
else if (action == ACTION_STD_CANCEL) else if (action == ACTION_STD_CANCEL)
return action; return action;