Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : apps/e_utils

Dir     : e17/apps/e_utils/src/bin/entangle


Modified Files:
        entangle_apps.c entangle_eapps.c 


Log Message:
ecore_file_ls

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/apps/e_utils/src/bin/entangle/entangle_apps.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- entangle_apps.c     5 Sep 2005 11:53:24 -0000       1.4
+++ entangle_apps.c     7 Oct 2005 08:33:34 -0000       1.5
@@ -90,21 +90,23 @@
     {
         Ecore_List *contents;
         int i;
+       char *name;
 
         contents = ecore_file_ls(dir);
-        for (i = 0; i < ecore_list_nodes(contents); i++)
-        {
-            char *name;
-            
-            name = ecore_list_goto_index(contents, i);
-            snprintf(path, PATH_MAX, "%s/%s", dir, name);
-
-            if (ecore_file_is_dir(path))
-                entangle_apps_dir_delete(path);
-
-            if (!ecore_file_unlink(path))
-                fprintf(stderr, "Error unlinking (%s).\n", path);
-        }
+       if (contents)
+       {
+           while ((name = ecore_list_next(contents)))
+           {
+               snprintf(path, PATH_MAX, "%s/%s", dir, name);
+
+               if (ecore_file_is_dir(path))
+                   entangle_apps_dir_delete(path);
+
+               if (!ecore_file_unlink(path))
+                  fprintf(stderr, "Error unlinking (%s).\n", path);
+           }
+           ecore_list_destroy(contents);
+       }
         if (!ecore_file_rmdir(dir))
             fprintf(stderr, "Error deleting (%s).\n", dir);
     }
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/apps/e_utils/src/bin/entangle/entangle_eapps.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- entangle_eapps.c    3 Oct 2005 20:23:21 -0000       1.6
+++ entangle_eapps.c    7 Oct 2005 08:33:34 -0000       1.7
@@ -14,6 +14,7 @@
     char *home;
     Ecore_List *eapps;
     int i;
+    char *name;
 
     home = getenv("HOME");
     if (!home)
@@ -39,9 +40,9 @@
     entangle_eapps = ecore_hash_new(ecore_str_hash, ecore_str_compare);
     entangle_eapp_list = ecore_list_new();
     ecore_hash_set_free_value(entangle_eapps, entangle_eapps_cb_free);
-    for (i = 0; i < ecore_list_nodes(eapps); i++)
+    while ((name = ecore_list_next(eapps)))
     {
-        char *ret, *tmp;
+        char *ret;
         int ret_size;
         Eet_File *ef;
         char e_path[PATH_MAX];
@@ -54,10 +55,9 @@
             continue;
         }
 
-        tmp = ecore_list_goto_index(eapps, i);
-        eapp->eapp_name = strdup(tmp);
+        eapp->eapp_name = strdup(name);
 
-        snprintf(e_path, PATH_MAX, "%s/%s", path, tmp);
+        snprintf(e_path, PATH_MAX, "%s/%s", path, name);
         eapp->path = strdup(e_path);
         ef = eet_open(e_path, EET_FILE_MODE_READ);
         if (!ef) 
@@ -96,8 +96,8 @@
 
         IF_FREE(ret);
 
-        ecore_hash_set(entangle_eapps, tmp, eapp);
-        ecore_list_append(entangle_eapp_list, tmp);
+        ecore_hash_set(entangle_eapps, eapp->eapp_name, eapp);
+        ecore_list_append(entangle_eapp_list, eapp->eapp_name);
         eet_close(ef);
     }
 




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to