diff options
author | Paul Louden <paulthenerd@gmail.com> | 2007-06-18 22:41:39 +0000 |
---|---|---|
committer | Paul Louden <paulthenerd@gmail.com> | 2007-06-18 22:41:39 +0000 |
commit | 5b25a6e2dfaa4a336a5690935db5b7eadba971c5 (patch) | |
tree | 0bff4dd4cab7cf1cdadb4f4c4b33f7e3b74a7b3c /apps | |
parent | f2061599d472264051c47bb323de156d637d3afe (diff) |
Added one more filetype. ??? in .colors lets you set the color for all
unknown filetypes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13669 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/filetypes.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c index 89933c8774..75c58cc752 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -126,7 +126,7 @@ static struct file_type filetypes[MAX_FILETYPES]; static int custom_filetype_icons[MAX_FILETYPES]; static bool custom_icons_loaded = false; #ifdef HAVE_LCD_COLOR -static int custom_colors[MAX_FILETYPES]; +static int custom_colors[MAX_FILETYPES+1]; #endif static int filetype_count = 0; static unsigned char heighest_attr = 0; @@ -166,6 +166,11 @@ void read_color_theme_file(void) { custom_colors[0] = hex_to_rgb(color); continue; } + if (!strcasecmp(ext, "???")) + { + custom_colors[MAX_FILETYPES] = hex_to_rgb(color); + continue; + } for (i=1; i<filetype_count; i++) { if (filetypes[i].extension && @@ -383,7 +388,7 @@ int filetype_get_color(const char * name, int attr) return custom_colors[0]; extension = strrchr(name, '.'); if (!extension) - return -1; + return custom_colors[MAX_FILETYPES]; extension++; logf("%s %s",name,extension); for (i=1; i<filetype_count; i++) @@ -392,7 +397,7 @@ int filetype_get_color(const char * name, int attr) !strcasecmp(extension, filetypes[i].extension)) return custom_colors[i]; } - return -1; + return custom_colors[MAX_FILETYPES]; } #endif |