From: Enlightenment S. <no-...@en...> - 2010-10-08 20:31:11
|
Log: avoid directories starting with '.' and faster check for directory. Author: barbieri Date: 2010-10-08 13:31:04 -0700 (Fri, 08 Oct 2010) New Revision: 53210 Modified: trunk/ephoto/src/bin/ephoto_thumb_browser.c Modified: trunk/ephoto/src/bin/ephoto_thumb_browser.c =================================================================== --- trunk/ephoto/src/bin/ephoto_thumb_browser.c 2010-10-08 20:25:18 UTC (rev 53209) +++ trunk/ephoto/src/bin/ephoto_thumb_browser.c 2010-10-08 20:31:04 UTC (rev 53210) @@ -239,14 +239,15 @@ static Eina_Bool _ephoto_populate_filter_directory(void *data, const char *file) { - const char *type; + const char *basename; + struct stat st; - if (!(type = efreet_mime_type_get(file))) - return EINA_FALSE; - if (!strncmp(type, "inode/directory", 15)) - return EINA_TRUE; + /* TODO: eio_file_ls_direct() and get more useful parameter than file */ + basename = ecore_file_file_get(file); + if ((!basename) || (basename[0] == '.')) + return EINA_FALSE; - return EINA_FALSE; + return ((stat(file, &st) == 0) && (S_ISDIR(st.st_mode))); } /* Check image type from another thread */ |