From a9c1df40014ebe548ab111fd28d854f22e231b5f Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 16 Apr 2007 14:33:29 +0000 Subject: * its name[rows][columns] you drongo! * make custom viewer icons work slightly better * minor nit-picks to keep crop happy * create a /.rockbox/themes/default_rockbox_icons.cfg to restore the default icons easily git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13183 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetypes.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'apps/filetypes.c') diff --git a/apps/filetypes.c b/apps/filetypes.c index 25dc0fe7da..832d67799b 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -63,6 +63,8 @@ struct file_type { char* extension; /* NULL for none */ }; static struct file_type filetypes[MAX_FILETYPES]; +static int custom_filetype_icons[MAX_FILETYPES]; +static bool custom_icons_loaded = false; static int filetype_count = 0; static unsigned char heighest_attr = 0; @@ -81,6 +83,10 @@ void read_viewer_theme_file(void) int fd; char *ext, *icon; int i; + custom_icons_loaded = false; + for (i=0; i= '0' && *icon <= '9') - filetypes[i].icon = Icon_Last_Themeable + atoi(icon); + custom_filetype_icons[i] = Icon_Last_Themeable + atoi(icon); break; } } } close(fd); + custom_icons_loaded = true; } #endif @@ -258,6 +265,8 @@ int filetype_get_icon(int attr) int index = find_attr(attr); if (index < 0) return Icon_NOICON; + if (custom_icons_loaded) + return custom_filetype_icons[index]; return filetypes[index].icon; } -- cgit v1.2.3