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);

View file

@ -42,7 +42,7 @@
#define DEFAULT_VIEWER_BMP ICON_DIR "/viewers.bmp"
#define DEFAULT_REMOTE_VIEWER_BMP ICON_DIR "/remote_viewers.bmp"
/* These should robably be moved to config-<target>.h */
/* These should probably be moved to config-<target>.h */
#define MAX_ICON_HEIGHT 24
#define MAX_ICON_WIDTH 24
@ -213,9 +213,9 @@ static void load_icons(const char* filename, enum Iconset iconset)
break;
#ifdef HAVE_REMOTE_LCD
case Iconset_Remotescreen:
loaded_ok = &custom_icons_loaded[SCREEN_MAIN];
bmp = &user_iconset[SCREEN_MAIN];
bmp->data = icon_buffer[SCREEN_MAIN];
loaded_ok = &custom_icons_loaded[SCREEN_REMOTE];
bmp = &user_iconset[SCREEN_REMOTE];
bmp->data = icon_buffer[SCREEN_REMOTE];
break;
case Iconset_Remotescreen_viewers:
loaded_ok = &viewer_icons_loaded[SCREEN_REMOTE];

View file

@ -19,7 +19,7 @@ rsp,viewers/searchengine,8
ss,rocks/sudoku,1
wav,viewers/wav2wv,-
wav,viewers/mp3_encoder,-
wav,viewers/wavplay,*0
wav,viewers/wavplay,10
wav,viewers/wavview,10
bmp,rocks/rockpaint,11
mpg,viewers/mpegplayer,4