Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fileman_smart.c 


Log Message:
Efm can add mime type icons (based on extentions so far) if they are simple
added to the theme. 


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- e_fileman_smart.c   14 Oct 2005 11:55:49 -0000      1.31
+++ e_fileman_smart.c   16 Oct 2005 14:02:15 -0000      1.32
@@ -1333,20 +1333,25 @@
        char *ext;
 
        ext = strrchr(file->attr->name, '.');
+                       
        if (ext)
          {
-            if (!strcasecmp(ext, ".pdf"))
-              e_theme_edje_object_set(icon_img, "base/theme/fileman", 
"fileman/icons/pdf");
-            else if (!strcasecmp(ext, ".c"))
-              e_theme_edje_object_set(icon_img, "base/theme/fileman", 
"fileman/icons/c");
-            else if (!strcasecmp(ext, ".h"))
-              e_theme_edje_object_set(icon_img, "base/theme/fileman", 
"fileman/icons/h");
-            else if (!strcasecmp(ext, ".jpg"))
-              e_theme_edje_object_set(icon_img, "base/theme/fileman", 
"fileman/icons/jpg");
-            else if (!strcasecmp(ext, ".png"))
-              e_theme_edje_object_set(icon_img, "base/theme/fileman", 
"fileman/icons/png");
-            else
+            char part[PATH_MAX];
+            char *ext2;
+            
+            ext = strdup(ext);
+            ext2 = ext;
+            for(;*ext2;ext2++)
+              *ext2 = (unsigned char)tolower((unsigned char)*ext2);
+                            
+            snprintf(part, PATH_MAX, "fileman/icons/%s", (ext + 1));
+            
+            printf("searching for %s (%s)\n", part, ext);
+            
+            if(!e_theme_edje_object_set(icon_img, "base/theme/fileman", part))
               e_theme_edje_object_set(icon_img, "base/theme/fileman", 
"fileman/icons/file");
+            
+            free(ext);
          }
        else
          e_theme_edje_object_set(icon_img, "base/theme/fileman", 
"fileman/icons/file");




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