summaryrefslogtreecommitdiffstats
path: root/apps/playlist_catalog.c
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2011-05-15 10:37:45 +0000
committerFrank Gevaerts <frank@gevaerts.be>2011-05-15 10:37:45 +0000
commit322bbf7c00881b701f88713a7f4410ed69775475 (patch)
treed506229abbb491de678a95ba11f8c0223ebac119 /apps/playlist_catalog.c
parentc949d69f4bfd9c9c68b344eb5bd3db537b44c410 (diff)
downloadrockbox-322bbf7c00881b701f88713a7f4410ed69775475.tar.gz
rockbox-322bbf7c00881b701f88713a7f4410ed69775475.tar.bz2
rockbox-322bbf7c00881b701f88713a7f4410ed69775475.zip
Prefill the playlist name when creating a new playlist from the file browser. FS#12104 by Ophir Lojkine
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29882 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist_catalog.c')
-rw-r--r--apps/playlist_catalog.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c
index dffc1671da..10c4f8b47c 100644
--- a/apps/playlist_catalog.c
+++ b/apps/playlist_catalog.c
@@ -306,7 +306,11 @@ bool catalog_add_to_a_playlist(const char* sel, int sel_attr,
size_t len;
if (m3u8name == NULL)
{
- snprintf(playlist, MAX_PATH, "%s/", playlist_dir);
+ /*If sel is a folder, we prefill the text field with its name*/
+ const char *name = strrchr(sel, '/');
+ snprintf(playlist, MAX_PATH, "%s/%s",
+ playlist_dir,
+ (name!=NULL && (sel_attr & ATTR_DIRECTORY))?name+1:"");
if (kbd_input(playlist, MAX_PATH))
return false;
}