Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : libs/efreet

Dir     : e17/libs/efreet/src/lib


Modified Files:
        efreet_icon.c 


Log Message:
Strip known extensions from icons.

===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_icon.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- efreet_icon.c       4 Apr 2007 10:41:53 -0000       1.10
+++ efreet_icon.c       4 Apr 2007 11:52:46 -0000       1.11
@@ -248,7 +248,35 @@
     efreet_array_cat(cache_key, sizeof(cache_key), key_list);
 
     share_key = ecore_string_instance(cache_key);
+#ifdef SLOPPY_SPEC
+    {
+        char *tmp, *ext;
+
+        tmp = strdup(icon);
+        ext = strrchr(tmp, '.');
+        if (ext)
+        {
+            const char *ext2;
+            ecore_list_goto_first(efreet_icon_extensions);
+            while ((ext2 = ecore_list_next(efreet_icon_extensions)))
+            {
+                if (!strcmp(ext, ext2))
+                {
+#ifdef STRICT_SPEC
+                    printf("[Efreet]: Requesting an icon with an extension: 
%s\n", icon);
+#endif
+                    *ext = 0;
+                    break;
+                }
+            }
+        }
+
+        value = efreet_icon_find_helper(theme, share_key, tmp, size);
+        free(tmp);
+    }
+#else
     value = efreet_icon_find_helper(theme, share_key, icon, size);
+#endif
 
     /* we didn't find the icon in the theme or in the inherited directories
      * then just look for a non theme icon */
@@ -575,6 +603,7 @@
         }
     }
     /* This is to catch non-conforming .desktop files */
+#ifdef SLOPPY_SPEC
     if (!icon)
     {
         const char *icon_path[] = { dir, "/", icon_name, NULL };
@@ -589,6 +618,7 @@
 #endif
         }
     }
+#endif
 
     return icon;
 }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to