summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/filetypes.c25
-rw-r--r--apps/onplay.c2
2 files changed, 25 insertions, 2 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 4e88f81dec..0f9f0c790a 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -246,6 +246,13 @@ int filetype_load_menu(struct menu_item* menu,int max_items)
246 { 246 {
247 if (filetypes[i].plugin) 247 if (filetypes[i].plugin)
248 { 248 {
249 int j;
250 for (j=0;j<cnt;j++) /* check if the plugin is in the list yet */
251 {
252 if (!strcmp(menu[j].desc,filetypes[i].plugin))
253 break;
254 }
255 if (j<cnt) continue; /* it is so grab the next plugin */
249 cp=strrchr(filetypes[i].plugin,'/'); 256 cp=strrchr(filetypes[i].plugin,'/');
250 if (cp) cp++; 257 if (cp) cp++;
251 else cp=filetypes[i].plugin; 258 else cp=filetypes[i].plugin;
@@ -261,9 +268,25 @@ int filetype_load_menu(struct menu_item* menu,int max_items)
261/* start a plugin with an argument (called from onplay.c) */ 268/* start a plugin with an argument (called from onplay.c) */
262int filetype_load_plugin(const char* plugin, char* file) 269int filetype_load_plugin(const char* plugin, char* file)
263{ 270{
271 int fd;
264 snprintf(plugin_name,sizeof(plugin_name),"%s/%s.rock", 272 snprintf(plugin_name,sizeof(plugin_name),"%s/%s.rock",
265 VIEWERS_DIR,plugin); 273 VIEWERS_DIR,plugin);
266 return plugin_load(plugin_name,file); 274 if ((fd = open(plugin_name,O_RDONLY))>=0)
275 {
276 close(fd);
277 return plugin_load(plugin_name,file);
278 }
279 else
280 {
281 snprintf(plugin_name,sizeof(plugin_name),"%s/%s.rock",
282 PLUGIN_DIR,plugin);
283 if ((fd = open(plugin_name,O_RDONLY))>=0)
284 {
285 close(fd);
286 return plugin_load(plugin_name,file);
287 }
288 }
289 return PLUGIN_ERROR;
267} 290}
268 291
269/* get index to filetypes[] from the file attribute */ 292/* get index to filetypes[] from the file attribute */
diff --git a/apps/onplay.c b/apps/onplay.c
index be11b9a2da..e057623c1c 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -628,7 +628,7 @@ int onplay(char* file, int attr, int from)
628 } 628 }
629 } 629 }
630 630
631 if (!(attr & ATTR_DIRECTORY) && attr) 631 if (!(attr & ATTR_DIRECTORY))
632 { 632 {
633 items[i].desc = ID2P(LANG_ONPLAY_OPEN_WITH); 633 items[i].desc = ID2P(LANG_ONPLAY_OPEN_WITH);
634 items[i].function = list_viewers; 634 items[i].function = list_viewers;