comparison 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
comparison
equal deleted inserted replaced
1422:91bed0d66cf2 1423:6933974f0885
827 g_list_free(flist); 827 g_list_free(flist);
828 828
829 return flist_filtered; 829 return flist_filtered;
830 } 830 }
831 831
832 static gboolean is_hidden_file(const gchar *name)
833 {
834 if (name[0] != '.') return FALSE;
835 if (name[1] == '\0' || (name[1] == '.' && name[2] == '\0')) return FALSE;
836 return TRUE;
837 }
838
832 static gboolean filelist_read_real(FileData *dir_fd, GList **files, GList **dirs, gboolean follow_symlinks) 839 static gboolean filelist_read_real(FileData *dir_fd, GList **files, GList **dirs, gboolean follow_symlinks)
833 { 840 {
834 DIR *dp; 841 DIR *dp;
835 struct dirent *dir; 842 struct dirent *dir;
836 gchar *pathl; 843 gchar *pathl;
862 { 869 {
863 struct stat ent_sbuf; 870 struct stat ent_sbuf;
864 const gchar *name = dir->d_name; 871 const gchar *name = dir->d_name;
865 gchar *filepath; 872 gchar *filepath;
866 873
867 if (!options->file_filter.show_hidden_files && ishidden(name)) 874 if (!options->file_filter.show_hidden_files && is_hidden_file(name))
868 continue; 875 continue;
869 876
870 filepath = g_build_filename(pathl, name, NULL); 877 filepath = g_build_filename(pathl, name, NULL);
871 if (stat_func(filepath, &ent_sbuf) >= 0) 878 if (stat_func(filepath, &ent_sbuf) >= 0)
872 { 879 {
995 while (work) 1002 while (work)
996 { 1003 {
997 FileData *fd = (FileData *)(work->data); 1004 FileData *fd = (FileData *)(work->data);
998 const gchar *name = fd->name; 1005 const gchar *name = fd->name;
999 1006
1000 if ((!options->file_filter.show_hidden_files && ishidden(name)) || 1007 if ((!options->file_filter.show_hidden_files && is_hidden_file(name)) ||
1001 (!is_dir_list && !filter_name_exists(name)) || 1008 (!is_dir_list && !filter_name_exists(name)) ||
1002 (is_dir_list && name[0] == '.' && (strcmp(name, GQ_CACHE_LOCAL_THUMB) == 0 || 1009 (is_dir_list && name[0] == '.' && (strcmp(name, GQ_CACHE_LOCAL_THUMB) == 0 ||
1003 strcmp(name, GQ_CACHE_LOCAL_METADATA) == 0)) ) 1010 strcmp(name, GQ_CACHE_LOCAL_METADATA) == 0)) )
1004 { 1011 {
1005 GList *link = work; 1012 GList *link = work;