summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2010-09-09 16:43:10 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2010-09-09 16:43:10 +0200
commit968d2366aa9963b05e00fd1f96dcd8c82c96184b (patch)
treeb4341c57a7d7833d3fc1ad69e0b8562a72884f3a
parent7ad624ebc6984dffa0c7cf767016c1e3fc2fe739 (diff)
settings: make displaying 'empty tag' entry optional
-rw-r--r--doc/config2
-rw-r--r--doc/ncmpcpp.13
-rw-r--r--src/media_library.cpp2
-rw-r--r--src/settings.cpp5
-rw-r--r--src/settings.h1
5 files changed, 13 insertions, 0 deletions
diff --git a/doc/config b/doc/config
index 32cc5113..a7708a07 100644
--- a/doc/config
+++ b/doc/config
@@ -378,6 +378,8 @@
#
#media_library_display_date = "yes"
#
+#media_library_display_empty_tag = "yes"
+#
#media_library_disable_two_column_mode = "no"
#
#enable_window_title = "yes"
diff --git a/doc/ncmpcpp.1 b/doc/ncmpcpp.1
index 9d0ace9c..46fa67fe 100644
--- a/doc/ncmpcpp.1
+++ b/doc/ncmpcpp.1
@@ -288,6 +288,9 @@ If enabled, tag editor will number tracks using format xx/yy (where xx is the cu
.B media_library_display_date = yes/no
If enabled, dates of albums in media library will be displayed and respected in searching, otherwise not.
.TP
+.B media_library_display_empty_tag = yes/no
+If enabled, left column will contain entry for 'empty' tag, otherwise not.
+.TP
.B media_library_disable_two_column_mode = yes/no
If enabled, pressing the key for the media library twice won't switch it to two column mode.
.TP
diff --git a/src/media_library.cpp b/src/media_library.cpp
index 949d8456..579b2ae8 100644
--- a/src/media_library.cpp
+++ b/src/media_library.cpp
@@ -196,6 +196,8 @@ void MediaLibrary::Update()
sort(list.begin(), list.end(), CaseInsensitiveSorting());
for (MPD::TagList::iterator it = list.begin(); it != list.end(); ++it)
{
+ if (it->empty() && !Config.media_library_display_empty_tag)
+ continue;
utf_to_locale(*it);
Artists->AddOption(*it);
}
diff --git a/src/settings.cpp b/src/settings.cpp
index 789bbee9..b9e6149c 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -410,6 +410,7 @@ void NcmpcppConfig::SetDefaults()
browser_sort_by_mtime = false;
tag_editor_extended_numeration = false;
media_library_display_date = true;
+ media_library_display_empty_tag = true;
media_library_disable_two_column_mode = false;
discard_colors_if_item_is_selected = true;
store_lyrics_in_song_dir = false;
@@ -1047,6 +1048,10 @@ void NcmpcppConfig::Read()
{
media_library_display_date = v == "yes";
}
+ else if (cl.find("media_library_display_empty_tag") != std::string::npos)
+ {
+ media_library_display_empty_tag = v == "yes";
+ }
else if (cl.find("media_library_disable_two_column_mode") != std::string::npos)
{
media_library_disable_two_column_mode = v == "yes";
diff --git a/src/settings.h b/src/settings.h
index 18b9c339..c5fe8f24 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -247,6 +247,7 @@ struct NcmpcppConfig
bool browser_sort_by_mtime;
bool tag_editor_extended_numeration;
bool media_library_display_date;
+ bool media_library_display_empty_tag;
bool media_library_disable_two_column_mode;
bool discard_colors_if_item_is_selected;
bool store_lyrics_in_song_dir;