diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-06 08:21:18 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-06 08:21:18 +0000 |
commit | 1b07ed05a41b891bebe105e18c8c344b17108e9b (patch) | |
tree | 1e6ac245183b1377a598caceafeb8fe57afdf232 /apps/tree.c | |
parent | 38be0e65d3304bd649c18a71d2c4551b0afd5a0a (diff) |
Fix FS#6716 - make it easier to follow the selected file going in and
out of the trees
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12638 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/tree.c b/apps/tree.c index 06b42b7c86..e4237dc598 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -474,6 +474,21 @@ void reload_directory(void) reload_dir = true; } +void get_current_file(char* buffer, int buffer_len) +{ +#ifdef HAVE_TAGCACHE + /* in ID3DB mode it is a bad idea to call this function */ + /* (only happens with `follow playlist') */ + if( *tc.dirfilter == SHOW_ID3DB ) + return; +#endif + + struct entry* dc = tc.dircache; + struct entry* e = &dc[tc.selected_item]; + snprintf(buffer, buffer_len, "%s/%s", getcwd(NULL,0), + e->name); +} + /* Selects a file and update tree context properly */ void set_current_file(char *path) { @@ -505,8 +520,6 @@ void set_current_file(char *path) strcpy(lastfile, name); - /* undefined item selected */ - tc.selected_item = -1; /* If we changed dir we must recalculate the dirlevel and adjust the selected history properly */ @@ -1153,6 +1166,7 @@ int rockbox_browse(const char *root, int dirfilter) int last_context; backup = tc; + tc.selected_item = 0; tc.dirlevel = 0; memcpy(tc.currdir, root, sizeof(tc.currdir)); start_wps = false; |