From d7c541742f5e6ec07dbcc8e1346efde9d807437e Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sat, 4 May 2024 08:41:16 -0400 Subject: Allow first level folders in plugin menu add sorting directories as files move picross files to a hidden folder use directory for lua_scripts, sgt_puzzles make plugin browser able to handle 1st level directories Change-Id: I30852d71dc992c378d5790756e94f06f5a2e9bef --- apps/tree.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index 2e82b165af..58457c2d71 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -466,6 +466,13 @@ static int update_dir(void) icon = tc.browse->icon; if (icon == NOICON) icon = filetype_get_icon(ATTR_DIRECTORY); + /* display sub directories in the title of plugin browser */ + if (tc.dirlevel > 0 && *tc.dirfilter == SHOW_PLUGINS) + { + char *subdir = strrchr(tc.currdir, '/'); + if (subdir) + title = subdir + 1; /* step past the separator */ + } } else { @@ -1056,7 +1063,7 @@ int rockbox_browse(struct browse_context *browse) int last_context; /* don't reset if its the same browse already loaded */ if (tc.browse != browse || - !(tc.currdir[1] && strcmp(tc.currdir, browse->root) == 0)) + !(tc.currdir[1] && strstr(tc.currdir, browse->root) != NULL)) { tc.browse = browse; tc.selected_item = 0; -- cgit v1.2.3