From aede9bef80987abcacae46fedd81603c0ba874d7 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 13 May 2014 15:42:57 +0200 Subject: [PATCH] entrance: files are now searched with eina_file instead of ecore_file --- src/daemon/entrance_image.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/daemon/entrance_image.c b/src/daemon/entrance_image.c index 6fab408..18ffd8d 100644 --- a/src/daemon/entrance_image.c +++ b/src/daemon/entrance_image.c @@ -8,22 +8,20 @@ static char *_entrance_image_homedir_get(const char *usr); static Eina_List * _entrance_image_readdir(const char *path) { - Eina_List *files; + Eina_Iterator *files; Eina_List *targets = NULL; - char *filename, buf[PATH_MAX]; + Eina_File_Direct_Info *file_stat; + char *buf; - files = ecore_file_ls(path); + files = eina_file_stat_ls(path); if (!files) return NULL; - EINA_LIST_FREE(files, filename) + EINA_ITERATOR_FOREACH(files, file_stat) { - snprintf(buf, sizeof(buf), "%s/%s", path, filename); - if ((!ecore_file_is_dir(buf)) && (filename[0] != '.')) - { - if (evas_object_image_extension_can_load_get(filename)) - targets = eina_list_append(targets, eina_stringshare_add(buf)); - } + buf = file_stat->path; + if (file_stat->type == EINA_FILE_REG && evas_object_image_extension_can_load_get(buf)) + targets = eina_list_append(targets, eina_stringshare_add(buf)); } - + eina_iterator_free(files); return targets; }