From 54d43ef0c139b1f6e5280b0ebfb82e6cc1a90060 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 5 May 2005 00:27:41 +0000 Subject: Hotswap support in file browser: Don't reload the root dir if not in the root and the current path is still valid. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6405 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index 31f436ce78..d713a2378b 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -1119,9 +1119,16 @@ static bool dirbrowse(void) case SYS_FS_CHANGED: if (!id3db) /* file browsing */ { - /* FixMe: skip this if not in root - and our path is still valid */ - reload_root = true; /* the dumb way */ + if (currdir[1]) /* not in the root */ + { + DIR *dir = opendir(currdir); + if (dir) /* path still valid */ + { + closedir(dir); + break; /* don't reload the root */ + } + } + reload_root = true; } break; #endif -- cgit v1.2.3