From e68306c8c0452f95fa0b664d7a5f7e71ea759125 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 14 Aug 2009 00:47:48 +0200 Subject: [PATCH] throw away full path from song format in favor of directory --- doc/config | 6 +++--- doc/ncmpcpp.1 | 2 +- src/display.cpp | 14 +++++++------- src/settings.cpp | 2 +- src/song.cpp | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/config b/doc/config index bd3e47f7..77475c8c 100644 --- a/doc/config +++ b/doc/config @@ -40,8 +40,8 @@ ## for song format you can use: ## ## %l - length -## %f - short filename -## %F - full filename +## %f - filename +## %D - directory ## %a - artist ## %t - title ## %b - album @@ -109,7 +109,7 @@ # #alternative_header_first_line_format = "$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b" # -#alternative_header_second_line_format = "{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}" +#alternative_header_second_line_format = "{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}" # ## colors are not supported for below variable # diff --git a/doc/ncmpcpp.1 b/doc/ncmpcpp.1 index 0950eee7..6479f6c2 100644 --- a/doc/ncmpcpp.1 +++ b/doc/ncmpcpp.1 @@ -269,7 +269,7 @@ For song format you can use: %l - length %f - filename - %F - full path + %D - directory %a - artist %t - title %b - album diff --git a/src/display.cpp b/src/display.cpp index 42800938..a700a68b 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -63,8 +63,8 @@ std::string Display::Columns() case 'f': tag = "Filename"; break; - case 'F': - tag = "Full filename"; + case 'D': + tag = "Directory"; break; case 'a': tag = "Artist"; @@ -147,8 +147,8 @@ void Display::SongsInColumns(const MPD::Song &s, void *, Menu *menu) case 'l': get = &MPD::Song::GetLength; break; - case 'F': - get = &MPD::Song::GetFile; + case 'D': + get = &MPD::Song::GetDirectory; break; case 'f': get = &MPD::Song::GetName; @@ -252,11 +252,11 @@ void Display::Songs(const MPD::Song &s, void *data, Menu *menu) else buf << TO_WSTRING(s.GetLength()); break; - case 'F': + case 'D': if (!right) - *menu << s.GetFile(); + *menu << s.GetDirectory(); else - buf << TO_WSTRING(s.GetFile()); + buf << TO_WSTRING(s.GetDirectory()); break; case 'f': if (!right) diff --git a/src/settings.cpp b/src/settings.cpp index d0b82360..6875a7fc 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -248,7 +248,7 @@ void DefaultConfiguration(ncmpcpp_config &conf) conf.song_library_format = "{%n - }{%t}|{%f}"; conf.tag_editor_album_format = "{(%y) }%b"; conf.new_header_first_line = "$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b"; - conf.new_header_second_line = "{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}"; + conf.new_header_second_line = "{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}"; conf.browser_playlist_prefix << clRed << "(playlist)" << clEnd << ' '; conf.pattern = "%n - %t"; conf.selected_item_prefix << clMagenta; diff --git a/src/song.cpp b/src/song.cpp index 5346dbec..bf44697e 100644 --- a/src/song.cpp +++ b/src/song.cpp @@ -317,8 +317,8 @@ std::string MPD::Song::Format_ParseBraces(std::string::const_iterator &it, std:: case 'l': get = &MPD::Song::GetLength; break; - case 'F': - get = &MPD::Song::GetFile; + case 'D': + get = &MPD::Song::GetDirectory; break; case 'f': get = &MPD::Song::GetName; @@ -404,8 +404,8 @@ std::string MPD::Song::toString(const std::string &format) const case 'l': result += GetLength(); break; - case 'F': - result += GetFile(); + case 'D': + result += GetDirectory(); break; case 'f': result += GetName();