changeset 1423:6933974f0885

Make ishidden() static to filedata.c and rename it is_hidden_file().
author zas_
date Thu, 12 Mar 2009 22:39:06 +0000
parents 91bed0d66cf2
children 0061979f7f6d
files src/filedata.c src/filefilter.c src/filefilter.h
diffstat 3 files changed, 9 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/filedata.c	Thu Mar 12 22:35:45 2009 +0000
+++ b/src/filedata.c	Thu Mar 12 22:39:06 2009 +0000
@@ -829,6 +829,13 @@
 	return flist_filtered;
 }
 
+static gboolean is_hidden_file(const gchar *name)
+{
+	if (name[0] != '.') return FALSE;
+	if (name[1] == '\0' || (name[1] == '.' && name[2] == '\0')) return FALSE;
+	return TRUE;
+}
+
 static gboolean filelist_read_real(FileData *dir_fd, GList **files, GList **dirs, gboolean follow_symlinks)
 {
 	DIR *dp;
@@ -864,7 +871,7 @@
 		const gchar *name = dir->d_name;
 		gchar *filepath;
 
-		if (!options->file_filter.show_hidden_files && ishidden(name))
+		if (!options->file_filter.show_hidden_files && is_hidden_file(name))
 			continue;
 
 		filepath = g_build_filename(pathl, name, NULL);
@@ -997,7 +1004,7 @@
 		FileData *fd = (FileData *)(work->data);
 		const gchar *name = fd->name;
 
-		if ((!options->file_filter.show_hidden_files && ishidden(name)) ||
+		if ((!options->file_filter.show_hidden_files && is_hidden_file(name)) ||
 		    (!is_dir_list && !filter_name_exists(name)) ||
 		    (is_dir_list && name[0] == '.' && (strcmp(name, GQ_CACHE_LOCAL_THUMB) == 0 ||
 						       strcmp(name, GQ_CACHE_LOCAL_METADATA) == 0)) )
--- a/src/filefilter.c	Thu Mar 12 22:35:45 2009 +0000
+++ b/src/filefilter.c	Thu Mar 12 22:39:06 2009 +0000
@@ -37,13 +37,6 @@
 static GList *file_sidecar_list = NULL; /* files with allowed sidecar */
 
 
-gint ishidden(const gchar *name)
-{
-	if (name[0] != '.') return FALSE;
-	if (name[1] == '\0' || (name[1] == '.' && name[2] == '\0')) return FALSE;
-	return TRUE;
-}
-
 static FilterEntry *filter_entry_new(const gchar *key, const gchar *description,
 				     const gchar *extensions, FileFormatClass file_class, 
 				     gboolean writable, gboolean allow_sidecar, gboolean enabled)
--- a/src/filefilter.h	Thu Mar 12 22:35:45 2009 +0000
+++ b/src/filefilter.h	Thu Mar 12 22:39:06 2009 +0000
@@ -50,7 +50,5 @@
 gchar *sidecar_ext_to_string(void);
 GList *sidecar_ext_get_list(void);
 
-gint ishidden(const gchar *name);
-
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */