Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_int_config_theme.c 


Log Message:


use the path list

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_theme.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- e_int_config_theme.c        2 Apr 2006 03:42:13 -0000       1.19
+++ e_int_config_theme.c        2 Apr 2006 03:56:07 -0000       1.20
@@ -125,13 +125,13 @@
    /* generate the core widget layout for a basic dialog */
    Evas_Object *o, *o2, *fr, *im = NULL;
    Evas_Object *il;
-   char buf[4096];
    char *homedir;
    Evas_Object *theme;
    char fulltheme[PATH_MAX];
-   int i = 0, j, selnum = -1;
+   int i = 0, selnum = -1;
    Ecore_Evas *eebuf;
    Evas *evasbuf;
+   Evas_List *l, *paths;
    
    theme = edje_object_add(evas);
    
@@ -145,42 +145,52 @@
    eebuf = ecore_evas_buffer_new(1, 1);
    evasbuf = ecore_evas_get(eebuf);
    o2 = edje_object_add(evasbuf);
-                 
-   for (j = 0; j < 2; j++)
+
+   paths = e_path_dir_list_get(path_themes);
+   for (l = paths; l; l = l->next)
      {
        Ecore_List *themes;
        char *themefile;
-            
-       if (j == 0)
+       E_Path_Dir *ep;
+       int detected;
+       
+       ep = l->data;
+
+       if (!ecore_file_is_dir(ep->dir)) continue;
+       themes = ecore_file_ls(ep->dir);
+       if (!themes) continue;
+       
+       detected = 0;
+       homedir = e_user_homedir_get();
+       if (homedir)
          {
-            homedir = e_user_homedir_get();
-            if (homedir)
+            if (!strncmp(ep->dir, homedir, strlen(homedir)))
               {
-                 snprintf(buf, sizeof(buf), "%s/.e/e/themes", homedir);
-                 free(homedir);
+                 e_widget_ilist_header_append(il, NULL, _("Personal"));
+                 i++;
+                 detected = 1;
               }
-            else
-              continue;
+            free(homedir);
          }
-       else if (j == 1)
-         snprintf(buf, sizeof(buf), "%s/data/themes", e_prefix_data_get());
-       if (!ecore_file_is_dir(buf)) continue;
-       themes = ecore_file_ls(buf);
-       if (!themes) continue;
-       if (j == 0)
+       if (!detected)
          {
-            e_widget_ilist_header_append(il, NULL, _("Personal"));
-            i++;
+            if (!strncmp(ep->dir, e_prefix_data_get(), 
strlen(e_prefix_data_get())))
+              {
+                 e_widget_ilist_header_append(il, NULL, _("System"));
+                 i++;
+                 detected = 1;
+              }
          }
-       else if (j == 1)
+       if (!detected)
          {
-            e_widget_ilist_header_append(il, NULL, _("System"));
+            e_widget_ilist_header_append(il, NULL, _("Other"));
             i++;
+            detected = 1;
          }
        
        while ((themefile = ecore_list_next(themes)))
          {
-            snprintf(fulltheme, sizeof(fulltheme), "%s/%s", buf, themefile);
+            snprintf(fulltheme, sizeof(fulltheme), "%s/%s", ep->dir, 
themefile);
             if (ecore_file_is_dir(fulltheme)) continue;
             
             /* minimum theme requirements */
@@ -220,6 +230,7 @@
        free(themefile);
        ecore_list_destroy(themes);
      }
+   if (paths) e_path_dir_list_free(paths);
    evas_object_del(o2);
    ecore_evas_free(eebuf);
 




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to