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
This commit is contained in:
Jonathan Gordon 2007-04-16 12:26:49 +00:00
parent 3124134a08
commit 4a16739bdd
2 changed files with 7 additions and 26 deletions

View file

@ -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

View file

@ -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
}