1
0
Fork 0
forked from len0rd/rockbox

Fix the wavplay icon

Fix copy+paste mistake
Fix typo in comment
Fix crash when trying to run a bmp
Reset the icons properly when loading a .icons file (hopefully will use the correct icon now)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13179 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-04-16 11:01:41 +00:00
parent bfa5577869
commit ccaf24a29c
3 changed files with 28 additions and 5 deletions

View file

@ -75,12 +75,33 @@ 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);
@ -265,6 +286,8 @@ char* filetype_get_plugin(const struct entry* file)
int index = find_attr(file->attr);
if (index < 0)
return NULL;
if (filetypes[index].viewer == NULL)
return NULL;
snprintf(plugin_name, MAX_PATH, "%s/%s.%s",
filetypes[index].viewer? VIEWERS_DIR: PLUGIN_DIR,
filetypes[index].plugin, ROCK_EXTENSION);