summaryrefslogtreecommitdiffstats
path: root/apps/tree.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-10-22 22:17:36 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2021-10-29 03:07:42 -0400
commitdc24a18cef83d88f4e6ab657ca0adfccf1051474 (patch)
tree3e07fe2e5fa1a75eb549bd770270d2985c8a640f /apps/tree.c
parent8ee24d8cb47939ff04fa42b1ae9719ebeba64d29 (diff)
downloadrockbox-dc24a18cef83d88f4e6ab657ca0adfccf1051474.tar.gz
rockbox-dc24a18cef83d88f4e6ab657ca0adfccf1051474.zip
PLUGINBROWSER make resumable
make the plugin browser remember the last item between invocations this has bugged me for the longest time dealing with the plugin_menu Fix a very old bug fix for reloading lang strings in the lang menu FS#8117, sending multiple ENTER_MENU_ITEM callbacks from different areas of the code makes it hard to keep track of where your callback is originating Change-Id: Ib0a61558c11ee4c772134378a7020ac0e10fc4ee
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 7fcced92c8..e35f769a14 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -967,11 +967,17 @@ int rockbox_browse(struct browse_context *browse)
if (*tc.dirfilter >= NUM_FILTER_MODES)
{
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.browse = browse;
+ tc.selected_item = 0;
+ tc.dirlevel = 0;
+
+ strlcpy(tc.currdir, browse->root, sizeof(tc.currdir));
+ }
- tc.browse = browse;
- tc.selected_item = 0;
- tc.dirlevel = 0;
- strlcpy(tc.currdir, browse->root, sizeof(tc.currdir));
start_wps = false;
last_context = curr_context;