Mercurial > geeqie
diff src/filedata.c @ 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 | 80462be81410 |
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)) )