From 0080271527e3bd6cb6ffa66c3a2800fd28ec7c11 Mon Sep 17 00:00:00 2001 From: gevaerts Date: Sun, 15 May 2011 10:37:45 +0000 Subject: [PATCH] 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 --- apps/playlist_catalog.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c index dffc1671d..10c4f8b47 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; } -- 2.11.4.GIT