From efbcece07b3a91f4b475559997f892e24751f0e6 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 4 Oct 2010 10:34:38 +0000 Subject: New setting to control the file browser start location. Set using the menu item in folder context menus, clear in the filebrowser settings. Can be abused to start selecting a *file* (or have a folder selected) instead of a starting inside a folder by removing the trailing / in the .cfg This only affects the file browser when it would open in / before (on boot, or when entereing after backing out of the browser before (*not* when exited with the menu action) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28206 a1c6a512-1295-4272-9138-f99709370657 --- apps/root_menu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'apps/root_menu.c') diff --git a/apps/root_menu.c b/apps/root_menu.c index 0f2e38e395..92e0c66ff6 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c @@ -115,6 +115,10 @@ static int browser(void* param) { strcpy(folder, current_track_path); } + else if (!strcmp(last_folder, "/")) + { + strcpy(folder, global_settings.start_directory); + } else { #ifdef HAVE_HOTSWAP @@ -142,9 +146,9 @@ static int browser(void* param) break; } } - if (!in_hotswap) + if (!in_hotswap) #endif - strcpy(folder, last_folder); + strcpy(folder, last_folder); } break; #ifdef HAVE_TAGCACHE @@ -252,7 +256,8 @@ static int browser(void* param) switch ((intptr_t)param) { case GO_TO_FILEBROWSER: - if (!get_current_file(last_folder, MAX_PATH)) + if (!get_current_file(last_folder, MAX_PATH) || + !strchr(&last_folder[1], '/')) { last_folder[0] = '/'; last_folder[1] = '\0'; -- cgit v1.2.3