Undo my previous commit and do the same with a parantheses change in filetree.c

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7342 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonas Häggqvist 2005-08-17 17:53:54 +00:00
parent b2b0a7ebcb
commit 280d9cc00a
5 changed files with 12 additions and 15 deletions

View file

@ -218,8 +218,7 @@ int ft_load(struct tree_context* c, const char* tempdir)
(((len == 1) &&
(!strncmp(entry->d_name, ".", 1))) ||
((len == 2) &&
(!strncmp(entry->d_name, "..", 2))) ||
c->hidedirs)) {
(!strncmp(entry->d_name, "..", 2))))) {
i--;
continue;
}
@ -258,19 +257,19 @@ int ft_load(struct tree_context* c, const char* tempdir)
#endif
/* filter out non-visible files */
if (!(dptr->attr & ATTR_DIRECTORY) && (
if ((!(dptr->attr & ATTR_DIRECTORY) && (
(*c->dirfilter == SHOW_PLAYLIST &&
(dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_M3U) ||
((*c->dirfilter == SHOW_MUSIC &&
(dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_MPA) &&
(dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_M3U) ||
(*c->dirfilter == SHOW_SUPPORTED && !filetype_supported(dptr->attr)) ||
(*c->dirfilter == SHOW_SUPPORTED && !filetype_supported(dptr->attr)))) ||
(*c->dirfilter == SHOW_WPS && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_WPS) ||
(*c->dirfilter == SHOW_CFG && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_CFG) ||
(*c->dirfilter == SHOW_LNG && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_LNG) ||
(*c->dirfilter == SHOW_MOD && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_MOD) ||
(*c->dirfilter == SHOW_FONT && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_FONT) ||
(*c->dirfilter == SHOW_PLUGINS && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_ROCK)))
(*c->dirfilter == SHOW_PLUGINS && (dptr->attr & TREE_ATTR_MASK) != TREE_ATTR_ROCK))
{
i--;
continue;

View file

@ -303,7 +303,7 @@ bool show_info(void)
static bool plugin_browse(void)
{
return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS, true);
return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS);
}
#ifdef HAVE_RECORDING

View file

@ -1020,17 +1020,17 @@ static bool browse_current(void)
static bool custom_wps_browse(void)
{
return rockbox_browse(ROCKBOX_DIR, SHOW_WPS, true);
return rockbox_browse(ROCKBOX_DIR, SHOW_WPS);
}
static bool custom_cfg_browse(void)
{
return rockbox_browse(ROCKBOX_DIR, SHOW_CFG, true);
return rockbox_browse(ROCKBOX_DIR, SHOW_CFG);
}
static bool language_browse(void)
{
return rockbox_browse(ROCKBOX_DIR LANG_DIR, SHOW_LNG, true);
return rockbox_browse(ROCKBOX_DIR LANG_DIR, SHOW_LNG);
}
static bool voice_menus(void)
@ -1092,7 +1092,7 @@ static bool voice_menu(void)
#ifdef HAVE_LCD_BITMAP
static bool font_browse(void)
{
return rockbox_browse(ROCKBOX_DIR FONT_DIR, SHOW_FONT, true);
return rockbox_browse(ROCKBOX_DIR FONT_DIR, SHOW_FONT);
}
static bool scroll_bar(void)
@ -1543,7 +1543,7 @@ static bool display_settings_menu(void)
static bool firmware_browse(void)
{
return rockbox_browse(ROCKBOX_DIR, SHOW_MOD, true);
return rockbox_browse(ROCKBOX_DIR, SHOW_MOD);
}
static bool battery_settings_menu(void)

View file

@ -1447,7 +1447,7 @@ bool create_playlist(void)
return true;
}
bool rockbox_browse(const char *root, int dirfilter, bool hidedirs)
bool rockbox_browse(const char *root, int dirfilter)
{
static struct tree_context backup;
@ -1456,7 +1456,6 @@ bool rockbox_browse(const char *root, int dirfilter, bool hidedirs)
memcpy(tc.currdir, root, sizeof(tc.currdir));
start_wps = false;
tc.dirfilter = &dirfilter;
tc.hidedirs = hidedirs;
dirbrowse();

View file

@ -150,7 +150,6 @@ struct tree_context {
int cursorpos[MAX_DIR_LEVELS];
char currdir[MAX_PATH]; /* file use */
int *dirfilter; /* file use */
bool hidedirs;
int filesindir;
int dirsindir; /* file use */
int dirlength; /* total number of entries in dir, incl. those not loaded */
@ -187,7 +186,7 @@ void tree_get_filetypes(const struct filetype**, int*);
void tree_init(void);
void browse_root(void);
void set_current_file(char *path);
bool rockbox_browse(const char *root, int dirfilter, bool hidedirs);
bool rockbox_browse(const char *root, int dirfilter);
bool create_playlist(void);
void resume_directory(const char *dir);
char *getcwd(char *buf, int size);