summaryrefslogtreecommitdiffstats
path: root/apps/tree.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-04-26 19:23:47 +0000
committerJens Arnold <amiconn@rockbox.org>2005-04-26 19:23:47 +0000
commit04ed408de9ea576a3b22ee44bac9483ca27124c6 (patch)
treea77c0bdbfe1fd236f589954723d908676ff73007 /apps/tree.c
parente4e3bce3b0c5fff972f1b9068e16d0fee204571e (diff)
downloadrockbox-04ed408de9ea576a3b22ee44bac9483ca27124c6.tar.gz
rockbox-04ed408de9ea576a3b22ee44bac9483ca27124c6.zip
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
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/tree.c b/apps/tree.c
index bd4fe37180..bcb96a8995 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -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 )