From dc2f3c47c9e3498c22c2e13270c5d35e1267fb32 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Fri, 8 Oct 2010 20:31:04 +0000 Subject: [PATCH] avoid directories starting with '.' and faster check for directory. SVN revision: 53210 --- src/bin/ephoto_thumb_browser.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c index 095590d..8ee4f6e 100644 --- a/src/bin/ephoto_thumb_browser.c +++ b/src/bin/ephoto_thumb_browser.c @@ -239,14 +239,15 @@ _ephoto_show_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) 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 */