summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c44
1 files changed, 11 insertions, 33 deletions
diff --git a/apps/tree.c b/apps/tree.c
index aedeeb1dfd..88fb2f3ab0 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -773,16 +773,18 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
773 int onplay_result; 773 int onplay_result;
774 774
775 if(!numentries) 775 if(!numentries)
776 break; 776 onplay_result = onplay(NULL, 0);
777 else {
778 if (currdir[1])
779 snprintf(buf, sizeof buf, "%s/%s",
780 currdir, dircache[dircursor+dirstart].name);
781 else
782 snprintf(buf, sizeof buf, "/%s",
783 dircache[dircursor+dirstart].name);
784 onplay_result = onplay(buf,
785 dircache[dircursor+dirstart].attr);
786 }
777 787
778 if (currdir[1])
779 snprintf(buf, sizeof buf, "%s/%s",
780 currdir, dircache[dircursor+dirstart].name);
781 else
782 snprintf(buf, sizeof buf, "/%s",
783 dircache[dircursor+dirstart].name);
784 onplay_result = onplay(buf,
785 dircache[dircursor+dirstart].attr);
786 switch (onplay_result) 788 switch (onplay_result)
787 { 789 {
788 case ONPLAY_OK: 790 case ONPLAY_OK:
@@ -1502,30 +1504,6 @@ bool create_playlist(void)
1502 return true; 1504 return true;
1503} 1505}
1504 1506
1505bool create_dir(void)
1506{
1507 char dirname[MAX_PATH];
1508 int rc;
1509 int pathlen;
1510
1511 memset(dirname, 0, sizeof dirname);
1512
1513 snprintf(dirname, sizeof dirname, "%s/",
1514 currdir[1] ? currdir : "");
1515
1516 pathlen = strlen(dirname);
1517 rc = kbd_input(dirname + pathlen, (sizeof dirname)-pathlen);
1518 if(rc < 0)
1519 return false;
1520
1521 rc = mkdir(dirname, 0);
1522 if(rc < 0) {
1523 splash(HZ, true, "%s %s", str(LANG_CREATE_DIR), str(LANG_FAILED));
1524 }
1525
1526 return true;
1527}
1528
1529bool rockbox_browse(char *root, int dirfilter) 1507bool rockbox_browse(char *root, int dirfilter)
1530{ 1508{
1531 bool rc; 1509 bool rc;