From 5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 26 Apr 2007 05:30:46 +0000 Subject: Fix a .icons loading bug which caused the tango iconset to not load. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13267 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetypes.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/filetypes.c b/apps/filetypes.c index 69448a7946..3e03c0bda1 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -141,6 +141,7 @@ void read_viewer_theme_file(void) int fd; char *ext, *icon; int i; + global_status.viewer_icon_count = 0; custom_icons_loaded = false; custom_filetype_icons[0] = Icon_Folder; for (i=1; i= '0' && *icon <= '9') - custom_filetype_icons[i] = Icon_Last_Themeable + atoi(icon); + { + int number = atoi(icon); + if (number > global_status.viewer_icon_count) + global_status.viewer_icon_count++; + custom_filetype_icons[i] = Icon_Last_Themeable + number; + } break; } } @@ -178,7 +184,6 @@ void read_viewer_theme_file(void) void filetype_init(void) { - int i; /* set the directory item first */ filetypes[0].extension = NULL; filetypes[0].plugin = NULL; @@ -191,14 +196,6 @@ void filetype_init(void) #ifdef HAVE_LCD_BITMAP read_viewer_theme_file(); #endif - /* figure out how many viewer icons have been loaded */ - global_status.viewer_icon_count = Icon_Last_Themeable; - for (i=1; i global_status.viewer_icon_count) - global_status.viewer_icon_count = custom_filetype_icons[i]; - } - global_status.viewer_icon_count -= Icon_Last_Themeable; } /* remove all white spaces from string */ -- cgit v1.2.3