From fda7d720c05b4a756f045e0c0f4afe9630edb5c5 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 6 Aug 2007 13:42:52 +0000 Subject: Accept FS#5464 - organise the rocks directory. If any plugins or "open with" optoins dont work please let me know... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14214 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetypes.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'apps/filetypes.c') diff --git a/apps/filetypes.c b/apps/filetypes.c index 7590b1b3e7..973f60e6e5 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -119,7 +119,6 @@ void tree_get_filetypes(const struct filetype** types, int* count) struct file_type { int icon; /* the icon which shall be used for it, NOICON if unknown */ - bool viewer; /* true if the rock is in viewers, false if in rocks */ unsigned char attr; /* FILETYPES_MASK >> 8 */ char* plugin; /* Which plugin to use, NULL if unknown, or builtin */ char* extension; /* NULL for none */ @@ -289,7 +288,6 @@ static void read_config(char* config_file) { char line[64], *s, *e; char extension[8], plugin[32]; - bool viewer; int fd = open(config_file, O_RDONLY); if (fd < 0) return; @@ -314,24 +312,15 @@ static void read_config(char* config_file) /* get the plugin */ s = e+1; - e = strchr(s, '/'); - if (!e) - continue; - *e = '\0'; - if (!strcasecmp("viewers", s)) - viewer = true; - else - viewer = false; - s = e+1; e = strchr(s, ','); if (!e) continue; *e = '\0'; + strcpy(plugin, s); /* ok, store this plugin/extension, check icon after */ filetypes[filetype_count].extension = filetypes_strdup(extension); filetypes[filetype_count].plugin = filetypes_strdup(plugin); - filetypes[filetype_count].viewer = viewer; filetypes[filetype_count].attr = heighest_attr +1; filetypes[filetype_count].icon = Icon_Questionmark; heighest_attr++; @@ -422,8 +411,7 @@ char* filetype_get_plugin(const struct entry* file) if (filetypes[index].plugin == NULL) return NULL; snprintf(plugin_name, MAX_PATH, "%s/%s.%s", - filetypes[index].viewer? VIEWERS_DIR: PLUGIN_DIR, - filetypes[index].plugin, ROCK_EXTENSION); + PLUGIN_DIR, filetypes[index].plugin, ROCK_EXTENSION); return plugin_name; } -- cgit v1.2.3