forked from len0rd/rockbox
FS#9033 by Alexander Levin, also a couple of minor typo fixes by me and making the inbuilt_filetypes array static
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17625 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1659a1a031
commit
11a667b6ca
2 changed files with 9 additions and 9 deletions
|
@ -48,7 +48,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* a table for the know file types */
|
/* a table for the know file types */
|
||||||
const struct filetype inbuilt_filetypes[] = {
|
static const struct filetype inbuilt_filetypes[] = {
|
||||||
{ "mp3", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
{ "mp3", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||||
{ "mp2", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
{ "mp2", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||||
{ "mpa", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
{ "mpa", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
|
||||||
|
@ -130,7 +130,7 @@ static bool custom_icons_loaded = false;
|
||||||
static int custom_colors[MAX_FILETYPES+1];
|
static int custom_colors[MAX_FILETYPES+1];
|
||||||
#endif
|
#endif
|
||||||
static int filetype_count = 0;
|
static int filetype_count = 0;
|
||||||
static unsigned char heighest_attr = 0;
|
static unsigned char highest_attr = 0;
|
||||||
|
|
||||||
static char *filetypes_strdup(char* string)
|
static char *filetypes_strdup(char* string)
|
||||||
{
|
{
|
||||||
|
@ -277,8 +277,8 @@ static void read_builtin_types(void)
|
||||||
filetypes[filetype_count].extension = inbuilt_filetypes[i].extension;
|
filetypes[filetype_count].extension = inbuilt_filetypes[i].extension;
|
||||||
filetypes[filetype_count].plugin = NULL;
|
filetypes[filetype_count].plugin = NULL;
|
||||||
filetypes[filetype_count].attr = inbuilt_filetypes[i].tree_attr>>8;
|
filetypes[filetype_count].attr = inbuilt_filetypes[i].tree_attr>>8;
|
||||||
if (filetypes[filetype_count].attr > heighest_attr)
|
if (filetypes[filetype_count].attr > highest_attr)
|
||||||
heighest_attr = filetypes[filetype_count].attr;
|
highest_attr = filetypes[filetype_count].attr;
|
||||||
filetypes[filetype_count].icon = inbuilt_filetypes[i].icon;
|
filetypes[filetype_count].icon = inbuilt_filetypes[i].icon;
|
||||||
filetype_count++;
|
filetype_count++;
|
||||||
}
|
}
|
||||||
|
@ -321,9 +321,9 @@ static void read_config(char* config_file)
|
||||||
/* ok, store this plugin/extension, check icon after */
|
/* ok, store this plugin/extension, check icon after */
|
||||||
filetypes[filetype_count].extension = filetypes_strdup(extension);
|
filetypes[filetype_count].extension = filetypes_strdup(extension);
|
||||||
filetypes[filetype_count].plugin = filetypes_strdup(plugin);
|
filetypes[filetype_count].plugin = filetypes_strdup(plugin);
|
||||||
filetypes[filetype_count].attr = heighest_attr +1;
|
filetypes[filetype_count].attr = highest_attr +1;
|
||||||
filetypes[filetype_count].icon = Icon_Questionmark;
|
filetypes[filetype_count].icon = Icon_Questionmark;
|
||||||
heighest_attr++;
|
highest_attr++;
|
||||||
/* get the icon */
|
/* get the icon */
|
||||||
s = e+1;
|
s = e+1;
|
||||||
if (*s == '*')
|
if (*s == '*')
|
||||||
|
@ -419,7 +419,7 @@ bool filetype_supported(int attr)
|
||||||
/**** Open With Screen ****/
|
/**** Open With Screen ****/
|
||||||
struct cb_data {
|
struct cb_data {
|
||||||
int *items;
|
int *items;
|
||||||
char *current_file;
|
const char *current_file;
|
||||||
};
|
};
|
||||||
|
|
||||||
static enum themable_icons openwith_get_icon(int selected_item, void * data)
|
static enum themable_icons openwith_get_icon(int selected_item, void * data)
|
||||||
|
@ -463,7 +463,7 @@ int filetype_list_viewers(const char* current_file)
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
int items[MAX_FILETYPES];
|
int items[MAX_FILETYPES];
|
||||||
struct simplelist_info info;
|
struct simplelist_info info;
|
||||||
struct cb_data data = { items, (char*)current_file };
|
struct cb_data data = { items, current_file };
|
||||||
for (i=0; i<filetype_count && count < MAX_FILETYPES; i++)
|
for (i=0; i<filetype_count && count < MAX_FILETYPES; i++)
|
||||||
{
|
{
|
||||||
if (filetypes[i].plugin)
|
if (filetypes[i].plugin)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
* $Id:
|
* $Id$
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002 Henrik Backe
|
* Copyright (C) 2002 Henrik Backe
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue