diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-04-26 05:30:46 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-04-26 05:30:46 +0000 |
| commit | 5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8 (patch) | |
| tree | 96c3a18ace1ce08354f305ba63e2b7111e563b7f /apps | |
| parent | 91a86daa9274a5acf8b5708624d2982813a533b2 (diff) | |
| download | rockbox-5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8.zip rockbox-5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8.tar.gz rockbox-5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8.tar.bz2 rockbox-5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8.tar.xz | |
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
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/filetypes.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c index 69448a7..3e03c0b 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<filetype_count; i++) @@ -166,7 +167,12 @@ void read_viewer_theme_file(void) else if (*icon == '-') custom_filetype_icons[i] = Icon_NOICON; else if (*icon >= '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<filetype_count; i++) - { - if (custom_filetype_icons[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 */ |