bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/misc/entrance.git/commit/?id=aede9bef80987abcacae46fedd81603c0ba874d7

commit aede9bef80987abcacae46fedd81603c0ba874d7
Author: Marcel Hollerbach <[email protected]>
Date:   Tue May 13 15:42:57 2014 +0200

    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;
 }
 

-- 


Reply via email to