Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_desktop


Modified Files:
        ecore_desktop_icon.c 


Log Message:
More defense, FDO specs are not real standards, so they tend to get
loosely followed.


===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_desktop/ecore_desktop_icon.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ecore_desktop_icon.c        20 Aug 2006 03:45:53 -0000      1.11
+++ ecore_desktop_icon.c        20 Aug 2006 16:40:45 -0000      1.12
@@ -514,24 +514,36 @@
                          {
                             char               *value;
 
-                            result->path = theme_path;
-                            result->name = (char 
*)ecore_hash_get(result->group, "Name");
-                            result->comment = (char 
*)ecore_hash_get(result->group, "Comment");
-                            result->inherits = (char 
*)ecore_hash_get(result->group, "Inherits");
-                            result->directories = (char 
*)ecore_hash_get(result->group, "Directories");
-                            value = (char *)ecore_hash_get(result->group, 
"Example");
+                             /* According to the spec, name and comment are 
required, but we can fake those easily enough. */
+                            value = (char *)ecore_hash_get(result->group, 
"Name");
                             if (!value)
-                               value = "exec";
-                            result->example = strdup(value);
-
-                            ecore_hash_set(icon_theme_cache, 
strdup(icon_theme), result);
+                               value = (char *) icon_theme;
+                            result->name = strdup(value);
+                            value = (char *)ecore_hash_get(result->group, 
"Comment");
+                            if (!value)
+                               value = "No comment provided.";
+                            result->comment = strdup(value);
+                            result->directories = (char 
*)ecore_hash_get(result->group, "Directories");
+                             /* FIXME: Directories is also required, don't 
feel like faking it for now. */
+                             if (result->directories)
+                               {
+                                  result->inherits = (char 
*)ecore_hash_get(result->group, "Inherits");
+                                  value = (char 
*)ecore_hash_get(result->group, "Example");
+                                  if (!value)
+                                     value = "exec";
+                                  result->example = strdup(value);
+
+                                   /* This passes the basic validation tests, 
mark it as real and cache it. */
+                                  result->path = theme_path;
+                                  ecore_hash_set(icon_theme_cache, 
strdup(icon_theme), result);
+                               }
                          }
                     }
 
                   if (!result->path)
                     {
+                       _ecore_desktop_icon_theme_destroy(result);
                        free(theme_path);
-                       free(result);
                        result = NULL;
                     }
                }
@@ -562,6 +574,8 @@
 _ecore_desktop_icon_theme_destroy(Ecore_Desktop_Icon_Theme * icon_theme)
 {
    if (icon_theme->path) free(icon_theme->path);
+   if (icon_theme->name) free(icon_theme->name);
+   if (icon_theme->comment) free(icon_theme->comment);
    if (icon_theme->example) free(icon_theme->example);
    free(icon_theme);
 }



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to