summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-05-05 00:27:41 +0000
committerJens Arnold <amiconn@rockbox.org>2005-05-05 00:27:41 +0000
commit54d43ef0c139b1f6e5280b0ebfb82e6cc1a90060 (patch)
tree4924018e48ab99724afae5e870f017456b1c82c1 /apps/tree.c
parent251deaa4cabb434a104b7d86c949d6777a8bb2bf (diff)
downloadrockbox-54d43ef0c139b1f6e5280b0ebfb82e6cc1a90060.tar.gz
rockbox-54d43ef0c139b1f6e5280b0ebfb82e6cc1a90060.zip
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
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c13
1 files changed, 10 insertions, 3 deletions
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)
1119 case SYS_FS_CHANGED: 1119 case SYS_FS_CHANGED:
1120 if (!id3db) /* file browsing */ 1120 if (!id3db) /* file browsing */
1121 { 1121 {
1122 /* FixMe: skip this if not in root 1122 if (currdir[1]) /* not in the root */
1123 and our path is still valid */ 1123 {
1124 reload_root = true; /* the dumb way */ 1124 DIR *dir = opendir(currdir);
1125 if (dir) /* path still valid */
1126 {
1127 closedir(dir);
1128 break; /* don't reload the root */
1129 }
1130 }
1131 reload_root = true;
1125 } 1132 }
1126 break; 1133 break;
1127#endif 1134#endif