[rhythmbox] rhythmdb: ignore hidden files while enumerating directories (bug #603444)



commit 512409fde7cb0c4920e0d728178a137ab5619f9e
Author: Jonathan Matthew <jonathan d14n org>
Date:   Tue Dec 1 22:19:02 2009 +1000

    rhythmdb: ignore hidden files while enumerating directories (bug #603444)

 rhythmdb/rhythmdb.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/rhythmdb/rhythmdb.c b/rhythmdb/rhythmdb.c
index 599b016..d1573e1 100644
--- a/rhythmdb/rhythmdb.c
+++ b/rhythmdb/rhythmdb.c
@@ -78,6 +78,7 @@ G_DEFINE_ABSTRACT_TYPE(RhythmDB, rhythmdb, G_TYPE_OBJECT)
 /* file attributes requested in RHYTHMDB_ACTION_ENUM_DIR */
 #define RHYTHMDB_FILE_CHILD_INFO_ATTRIBUTES		\
 	RHYTHMDB_FILE_INFO_ATTRIBUTES ","		\
+	G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN ","		\
 	G_FILE_ATTRIBUTE_STANDARD_NAME
 
 /*
@@ -2858,6 +2859,12 @@ rhythmdb_execute_enum_dir (RhythmDB *db,
 			continue;
 		}
 
+		if (g_file_info_get_attribute_boolean (file_info, G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN)) {
+			rb_debug ("ignoring hidden file %s", g_file_info_get_name (file_info));
+			g_object_unref (file_info);
+			continue;
+		}
+
 		child = g_file_get_child (dir, g_file_info_get_name (file_info));
 		child_uri = g_file_get_uri (child);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]