1
0
Fork 0
forked from len0rd/rockbox

ID3DB: Reload database when returning from USB mode. Fixed reload_root issue in id3db browse mode. The database is now properly closed before entering USB mode.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6358 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-04-26 19:23:47 +00:00
parent e4e3bce3b0
commit 04ed408de9
3 changed files with 23 additions and 3 deletions

View file

@ -625,6 +625,12 @@ static bool check_changed_id3mode(bool currmode)
return currmode;
}
static void tree_prepare_usb(void *parameter)
{
(void) parameter;
db_shutdown();
}
static bool dirbrowse(void)
{
int numentries=0;
@ -1121,8 +1127,10 @@ static bool dirbrowse(void)
#endif
default:
if(default_event_handler(button) == SYS_USB_CONNECTED)
if (default_event_handler_ex(button, tree_prepare_usb, NULL)
== SYS_USB_CONNECTED)
{
db_init(); /* re-init database */
if(*tc.dirfilter > NUM_FILTER_MODES)
/* leave sub-browsers after usb, doing otherwise
might be confusing to the user */
@ -1160,6 +1168,10 @@ static bool dirbrowse(void)
if ( reload_root ) {
strcpy(currdir, "/");
tc.dirlevel = 0;
tc.currtable = 0;
tc.currextra = 0;
lasttable = -1;
lastextra = -1;
reload_root = false;
}
if (! reload_dir )