summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2011-03-11 14:45:31 +0000
committerphintuka <phintuka>2011-03-11 14:45:31 +0000
commit66fb4b974512c8606f76e19df7419fe37d12e074 (patch)
tree0b942a7aad95bc09b1cd14473e069039dc2ca7f0
parenta3edbb1371e6427d315b1b60564367d055c1ff1e (diff)
downloadxineliboutput-66fb4b974512c8606f76e19df7419fe37d12e074.tar.gz
xineliboutput-66fb4b974512c8606f76e19df7419fe37d12e074.tar.bz2
Do not show hidden files in media player file browser
(added config entry to show hidden files)
-rw-r--r--config.c4
-rw-r--r--config.h3
-rw-r--r--menu.c5
-rw-r--r--setup_menu.c5
4 files changed, 12 insertions, 5 deletions
diff --git a/config.c b/config.c
index e46e7de1..12d1d61b 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c,v 1.101 2011-02-28 13:37:10 phintuka Exp $
+ * $Id: config.c,v 1.102 2011-03-11 14:45:31 phintuka Exp $
*
*/
@@ -681,6 +681,7 @@ config_t::config_t() {
strn0cpy(browse_files_dir, VideoDirectory, sizeof(browse_files_dir));
strn0cpy(browse_music_dir, VideoDirectory, sizeof(browse_music_dir));
strn0cpy(browse_images_dir, VideoDirectory, sizeof(browse_images_dir));
+ show_hidden_files = 0;
cache_implicit_playlists = 1;
enable_id3_scanner = 1;
dvd_arrow_keys_control_playback = 1;
@@ -988,6 +989,7 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "Media.BrowseFilesDir")) STRN0CPY(browse_files_dir, Value);
else if (!strcasecmp(Name, "Media.BrowseMusicDir")) STRN0CPY(browse_music_dir, Value);
else if (!strcasecmp(Name, "Media.BrowseImagesDir")) STRN0CPY(browse_images_dir, Value);
+ else if (!strcasecmp(Name, "Media.ShowHiddenFiles")) show_hidden_files = atoi(Value);
else if (!strcasecmp(Name, "Media.CacheImplicitPlaylists")) cache_implicit_playlists = atoi(Value);
else if (!strcasecmp(Name, "Media.EnableID3Scanner")) enable_id3_scanner = atoi(Value);
else if (!strcasecmp(Name, "Media.DVD.ArrowKeysControlPlayback")) dvd_arrow_keys_control_playback = atoi(Value);
diff --git a/config.h b/config.h
index 87655d54..19a77607 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h,v 1.76 2011-02-28 13:39:58 phintuka Exp $
+ * $Id: config.h,v 1.77 2011-03-11 14:45:31 phintuka Exp $
*
*/
@@ -329,6 +329,7 @@ class config_t {
char browse_files_dir[4096];
char browse_music_dir[4096];
char browse_images_dir[4096];
+ int show_hidden_files;
int cache_implicit_playlists; // used in playlist.c
int enable_id3_scanner; // used in playlist.c
int subtitle_vpos; // used in media player. Not saved !
diff --git a/menu.c b/menu.c
index e8fb3ac2..dbab9a09 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c,v 1.83 2010-12-19 14:41:10 phintuka Exp $
+ * $Id: menu.c,v 1.84 2011-03-11 14:45:31 phintuka Exp $
*
*/
@@ -389,7 +389,8 @@ bool cMenuBrowseFiles::ScanDir(const char *DirName)
if (d) {
struct dirent *e;
while ((e = readdir(d)) != NULL) {
- if (strcmp(e->d_name, ".") && strcmp(e->d_name, "..")) {
+ if (strcmp(e->d_name, ".") && strcmp(e->d_name, "..") &&
+ (e->d_name[0] != '.' || xc.show_hidden_files)) {
cString buffer = cString::sprintf("%s/%s", DirName, e->d_name);
struct stat st;
if (stat(buffer, &st) == 0) {
diff --git a/setup_menu.c b/setup_menu.c
index 6308c80a..46cfc083 100644
--- a/setup_menu.c
+++ b/setup_menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: setup_menu.c,v 1.80 2011-01-10 11:01:14 phintuka Exp $
+ * $Id: setup_menu.c,v 1.81 2011-03-11 14:45:31 phintuka Exp $
*
*/
@@ -1765,6 +1765,8 @@ void cMenuSetupMediaPlayer::Set(void)
Add(new cMenuEditBoolItem(tr("Arrow keys control DVD playback"),
&newconfig.dvd_arrow_keys_control_playback));
+ Add(new cMenuEditBoolItem(tr("Show hidden files"),
+ &newconfig.show_hidden_files));
Add(SeparatorItem(tr("Media Player")));
Add(new cMenuEditBitItem(tr("Play file"), &newconfig.media_menu_items, MEDIA_MENU_FILES));
@@ -1798,6 +1800,7 @@ void cMenuSetupMediaPlayer::Store(void)
SetupStore("Media.EnableID3Scanner", xc.enable_id3_scanner);
SetupStore("Media.DVD.ArrowKeysControlPlayback", xc.dvd_arrow_keys_control_playback);
SetupStore("Media.MenuItems", xc.media_menu_items);
+ SetupStore("Media.ShowHiddenFiles", xc.show_hidden_files);
Setup.Save();
}