make displaying hidden files in local browser optional

This commit is contained in:
Andrzej Rybczak
2009-05-07 15:17:59 +02:00
parent f92b0101aa
commit 5682734840
5 changed files with 13 additions and 0 deletions

View File

@@ -148,6 +148,8 @@
# #
#ncmpc_like_songs_adding = "no" (enabled - add/remove, disabled - always add) #ncmpc_like_songs_adding = "no" (enabled - add/remove, disabled - always add)
# #
#show_hidden_files_in_local_browser = "no"
#
#display_screens_numbers_on_start = "yes" #display_screens_numbers_on_start = "yes"
# #
#clock_display_seconds = "no" #clock_display_seconds = "no"

View File

@@ -165,6 +165,9 @@ If enabled, lyrics will be switched at song's change to currently playing one's
.B ncmpc_like_songs_adding = yes/no .B ncmpc_like_songs_adding = yes/no
If enabled, pressing space on item, which is already in playlist will remove it, otherwise add it again. If enabled, pressing space on item, which is already in playlist will remove it, otherwise add it again.
.TP .TP
.B show_hidden_files_in_local_browser = yes/no
Trigger for displaying in local browser files and directories that begin with '.'
.TP
.B default_place_to_search_in = database/playlist .B default_place_to_search_in = database/playlist
If set to "playlist", Search engine will perform searching in current MPD playlist rather than in music database. If set to "playlist", Search engine will perform searching in current MPD playlist rather than in music database.
.TP .TP

View File

@@ -342,6 +342,8 @@ void Browser::GetLocalDirectory(ItemList &v)
while ((file = readdir(dir))) while ((file = readdir(dir)))
{ {
if (!Config.local_browser_show_hidden_files && file->d_name[0] == '.')
continue;
Item new_item; Item new_item;
full_path = itsBrowsedDir; full_path = itsBrowsedDir;
if (itsBrowsedDir != "/") if (itsBrowsedDir != "/")

View File

@@ -270,6 +270,7 @@ void DefaultConfiguration(ncmpcpp_config &conf)
conf.incremental_seeking = true; conf.incremental_seeking = true;
conf.now_playing_lyrics = false; conf.now_playing_lyrics = false;
conf.local_browser = false; conf.local_browser = false;
conf.local_browser_show_hidden_files = false;
conf.search_in_db = true; conf.search_in_db = true;
conf.display_screens_numbers_on_start = true; conf.display_screens_numbers_on_start = true;
conf.clock_display_seconds = false; conf.clock_display_seconds = false;
@@ -627,6 +628,10 @@ void ReadConfiguration(ncmpcpp_config &conf)
{ {
conf.incremental_seeking = v == "yes"; conf.incremental_seeking = v == "yes";
} }
else if (cl.find("show_hidden_files_in_local_browser") != string::npos)
{
conf.local_browser_show_hidden_files = v == "yes";
}
else if (cl.find("follow_now_playing_lyrics") != string::npos) else if (cl.find("follow_now_playing_lyrics") != string::npos)
{ {
conf.now_playing_lyrics = v == "yes"; conf.now_playing_lyrics = v == "yes";

View File

@@ -161,6 +161,7 @@ struct ncmpcpp_config
bool incremental_seeking; bool incremental_seeking;
bool now_playing_lyrics; bool now_playing_lyrics;
bool local_browser; bool local_browser;
bool local_browser_show_hidden_files;
bool search_in_db; bool search_in_db;
bool display_screens_numbers_on_start; bool display_screens_numbers_on_start;
bool clock_display_seconds; bool clock_display_seconds;