summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/filetypes.c15
-rw-r--r--apps/plugins/viewers.config2
2 files changed, 14 insertions, 3 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 973f60e..77d73df 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<filetype_count && count < (MAX_FILETYPES/2); i++)
{
if (filetypes[i].plugin)
@@ -440,8 +444,15 @@ int filetype_list_viewers(const char* current_file)
}
if (j<count)
continue; /* it is so grab the next plugin */
- strings[count] = filetypes[i].plugin;
- count++;
+ if (ext && filetypes[i].extension &&
+ (filetypes[i].extension[0] != '*'))
+ {
+ if (strcasecmp(filetypes[i].extension, ext))
+ continue; /* skip this one */
+ }
+ strings[count] = strrchr(filetypes[i].plugin,'/');
+ if (strings[count])
+ strings[count++]++;
}
}
#ifndef HAVE_LCD_BITMAP
diff --git a/apps/plugins/viewers.config b/apps/plugins/viewers.config
index 57bb5b4..938a47a 100644
--- a/apps/plugins/viewers.config
+++ b/apps/plugins/viewers.config
@@ -33,7 +33,7 @@ tap,viewers/zxbox,12
sna,viewers/zxbox,12
tzx,viewers/zxbox,12
z80,viewers/zxbox,12
-zzz,viewers/properties,-
+*,viewers/properties,-
colours,apps/text_editor,11
ssg,games/superdom,-
link,viewers/shortcuts,-