diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-04-16 12:26:49 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-04-16 12:26:49 +0000 |
| commit | 4a16739bddbff2ecd629c8a131ddce9e96c93c3a (patch) | |
| tree | edd14c0a125a95506d26e742c127ce53bce03fd2 | |
| parent | 3124134a086e775ad61e97bd0c82758d81faec66 (diff) | |
| download | rockbox-4a16739bddbff2ecd629c8a131ddce9e96c93c3a.zip rockbox-4a16739bddbff2ecd629c8a131ddce9e96c93c3a.tar.gz rockbox-4a16739bddbff2ecd629c8a131ddce9e96c93c3a.tar.bz2 rockbox-4a16739bddbff2ecd629c8a131ddce9e96c93c3a.tar.xz | |
Some gremlins got into my computer again and changed all my code!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13181 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/filetypes.c | 27 | ||||
| -rw-r--r-- | apps/gui/icon.c | 6 |
2 files changed, 7 insertions, 26 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c index 407f3a0..25dc0fe 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -75,33 +75,12 @@ static char *filetypes_strdup(char* string) static void read_builtin_types(void); static void read_config(char* config_file); #ifdef HAVE_LCD_BITMAP - -static void reset_icons(void) -{ - int i, j, count; - const struct filetype *types; - tree_get_filetypes(&types, &count); - for (i=1; i<filetype_count; i++) /* 0 is folders */ - { - filetypes[i].icon = Icon_Questionmark; - for (j=0; j<count; j++) - { - if (filetypes[i].extension && - !strcmp(filetypes[i].extension, types[j].extension)) - { - filetypes[i].icon = types[j].icon; - break; - } - } - } -} void read_viewer_theme_file(void) { char buffer[MAX_PATH]; int fd; char *ext, *icon; int i; - reset_icons(); snprintf(buffer, MAX_PATH, "%s/%s.icons", ICON_DIR, global_settings.viewers_icon_file); fd = open(buffer, O_RDONLY); @@ -119,7 +98,8 @@ void read_viewer_theme_file(void) filetypes[i].icon = atoi(icon+1); else if (*icon == '-') filetypes[i].icon = Icon_NOICON; - else filetypes[i].icon = Icon_Last_Themeable + atoi(icon); + else if (*icon >= '0' && *icon <= '9') + filetypes[i].icon = Icon_Last_Themeable + atoi(icon); break; } } @@ -234,7 +214,8 @@ static void read_config(char* config_file) filetypes[filetype_count].icon = atoi(s+1); else if (*s == '-') filetypes[filetype_count].icon = Icon_NOICON; - else filetypes[filetype_count].icon = Icon_Last_Themeable + atoi(s); + else if (*s >= '0' && *s <= '9') + filetypes[filetype_count].icon = Icon_Last_Themeable + atoi(s); #else filetypes[filetype_count].icon = Icon_NOICON; #endif diff --git a/apps/gui/icon.c b/apps/gui/icon.c index b283ec2..647c154 100644 --- a/apps/gui/icon.c +++ b/apps/gui/icon.c @@ -134,8 +134,8 @@ void screen_put_iconxy(struct screen * display, else if (icon >= Icon_Last_Themeable) { icon -= Icon_Last_Themeable; - if (!viewer_icons_loaded[screen] || - (icon*ICON_HEIGHT(screen) > viewer_iconset[screen].height)) + if (!viewer_icons_loaded[screen]/* || + (icon*ICON_HEIGHT(screen) > viewer_iconset[screen].height)*/) { screen_clear_area(display, xpos, ypos, ICON_WIDTH(screen), ICON_HEIGHT(screen)); @@ -270,7 +270,7 @@ void icons_init(void) load_icons(path, Iconset_Remotescreen_viewers); } else - load_icons(DEFAULT_REMOTE_VIEWER_BMP, Iconset_Mainscreen_viewers); + load_icons(DEFAULT_REMOTE_VIEWER_BMP, Iconset_Remotescreen_viewers); #endif } |