diff --git a/apps/filetree.c b/apps/filetree.c index c7a2dbf071..e6ba08b96e 100644 --- a/apps/filetree.c +++ b/apps/filetree.c @@ -218,7 +218,8 @@ int ft_load(struct tree_context* c, const char* tempdir) (((len == 1) && (!strncmp(entry->d_name, ".", 1))) || ((len == 2) && - (!strncmp(entry->d_name, "..", 2))))) { + (!strncmp(entry->d_name, "..", 2))) || + c->hidedirs)) { i--; continue; } diff --git a/apps/tree.c b/apps/tree.c index 8e1afb8b67..1a7f1045f7 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -1447,7 +1447,7 @@ bool create_playlist(void) return true; } -bool rockbox_browse(const char *root, int dirfilter) +bool rockbox_browse(const char *root, int dirfilter, bool hidedirs) { static struct tree_context backup; @@ -1456,6 +1456,7 @@ bool rockbox_browse(const char *root, int dirfilter) memcpy(tc.currdir, root, sizeof(tc.currdir)); start_wps = false; tc.dirfilter = &dirfilter; + tc.hidedirs = hidedirs; dirbrowse(); diff --git a/apps/tree.h b/apps/tree.h index 41ef0e527f..2e6b21dd3a 100644 --- a/apps/tree.h +++ b/apps/tree.h @@ -150,6 +150,7 @@ 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 */ @@ -186,7 +187,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 rockbox_browse(const char *root, int dirfilter, bool hidedirs); bool create_playlist(void); void resume_directory(const char *dir); char *getcwd(char *buf, int size);