diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2005-05-05 00:27:41 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2005-05-05 00:27:41 +0000 |
| commit | 54d43ef0c139b1f6e5280b0ebfb82e6cc1a90060 (patch) | |
| tree | 4924018e48ab99724afae5e870f017456b1c82c1 | |
| parent | 251deaa4cabb434a104b7d86c949d6777a8bb2bf (diff) | |
| download | rockbox-54d43ef0c139b1f6e5280b0ebfb82e6cc1a90060.zip rockbox-54d43ef0c139b1f6e5280b0ebfb82e6cc1a90060.tar.gz rockbox-54d43ef0c139b1f6e5280b0ebfb82e6cc1a90060.tar.bz2 rockbox-54d43ef0c139b1f6e5280b0ebfb82e6cc1a90060.tar.xz | |
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
| -rw-r--r-- | apps/tree.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/tree.c b/apps/tree.c index 31f436c..d713a23 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 |