summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-04-26 05:30:46 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-04-26 05:30:46 +0000
commit5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8 (patch)
tree96c3a18ace1ce08354f305ba63e2b7111e563b7f
parent91a86daa9274a5acf8b5708624d2982813a533b2 (diff)
downloadrockbox-5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8.tar.gz
rockbox-5b5d1018d065e6fd44dca73d2a5e6f2eaf7850a8.zip
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
-rw-r--r--apps/filetypes.c17
1 files 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)
141 int fd; 141 int fd;
142 char *ext, *icon; 142 char *ext, *icon;
143 int i; 143 int i;
144 global_status.viewer_icon_count = 0;
144 custom_icons_loaded = false; 145 custom_icons_loaded = false;
145 custom_filetype_icons[0] = Icon_Folder; 146 custom_filetype_icons[0] = Icon_Folder;
146 for (i=1; i<filetype_count; i++) 147 for (i=1; i<filetype_count; i++)
@@ -166,7 +167,12 @@ void read_viewer_theme_file(void)
166 else if (*icon == '-') 167 else if (*icon == '-')
167 custom_filetype_icons[i] = Icon_NOICON; 168 custom_filetype_icons[i] = Icon_NOICON;
168 else if (*icon >= '0' && *icon <= '9') 169 else if (*icon >= '0' && *icon <= '9')
169 custom_filetype_icons[i] = Icon_Last_Themeable + atoi(icon); 170 {
171 int number = atoi(icon);
172 if (number > global_status.viewer_icon_count)
173 global_status.viewer_icon_count++;
174 custom_filetype_icons[i] = Icon_Last_Themeable + number;
175 }
170 break; 176 break;
171 } 177 }
172 } 178 }
@@ -178,7 +184,6 @@ void read_viewer_theme_file(void)
178 184
179void filetype_init(void) 185void filetype_init(void)
180{ 186{
181 int i;
182 /* set the directory item first */ 187 /* set the directory item first */
183 filetypes[0].extension = NULL; 188 filetypes[0].extension = NULL;
184 filetypes[0].plugin = NULL; 189 filetypes[0].plugin = NULL;
@@ -191,14 +196,6 @@ void filetype_init(void)
191#ifdef HAVE_LCD_BITMAP 196#ifdef HAVE_LCD_BITMAP
192 read_viewer_theme_file(); 197 read_viewer_theme_file();
193#endif 198#endif
194 /* figure out how many viewer icons have been loaded */
195 global_status.viewer_icon_count = Icon_Last_Themeable;
196 for (i=1; i<filetype_count; i++)
197 {
198 if (custom_filetype_icons[i] > global_status.viewer_icon_count)
199 global_status.viewer_icon_count = custom_filetype_icons[i];
200 }
201 global_status.viewer_icon_count -= Icon_Last_Themeable;
202} 199}
203 200
204/* remove all white spaces from string */ 201/* remove all white spaces from string */