diff options
author | Andreas Obergrusberger <tradiaz@yahoo.de> | 2006-10-05 18:19:46 +0000 |
---|---|---|
committer | Andreas Obergrusberger <tradiaz@yahoo.de> | 2006-10-05 18:19:46 +0000 |
commit | bff18fcc0031584a43b271eba7bd6d538a1028c9 (patch) | |
tree | c61a47253e42f93f11669b44e2a9d7a53b042921 /src/screen_file.c | |
parent | 2373f8189ff927dd472f3fd0bf2741ac631a3440 (diff) | |
download | mpd-bff18fcc0031584a43b271eba7bd6d538a1028c9.tar.gz mpd-bff18fcc0031584a43b271eba7bd6d538a1028c9.tar.xz mpd-bff18fcc0031584a43b271eba7bd6d538a1028c9.zip |
you can specify %shortalbum% for playlist song markup, parent directory is shown in the browse screen title
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4871 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/screen_file.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/screen_file.c b/src/screen_file.c index 2d8c1dea8..b2d320f0b 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -549,7 +549,20 @@ browse_close(void) static char * browse_title(char *str, size_t size) { - g_snprintf(str, size, _("Browse: %s"), basename(filelist->path)); + char *pathcopy; + char *parentdir; + pathcopy = strdup(filelist->path); + parentdir = dirname(pathcopy); + parentdir = basename(parentdir); + if( parentdir[0] == '.' && strlen(parentdir) == 1 ) + { + parentdir = NULL; + } + g_snprintf(str, size, _("Browse: %s%s%s"), + parentdir ? parentdir : "", + parentdir ? "/" : "", + basename(filelist->path)); + free(pathcopy); return str; } |