Enlightenment CVS committal

Author  : atmosphere
Project : misc
Module  : engage

Dir     : misc/engage/src


Modified Files:
        icon.c userconfig.c 


Log Message:
fix a segv
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/icon.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- icon.c      20 Apr 2004 23:16:53 -0000      1.20
+++ icon.c      21 Apr 2004 04:27:13 -0000      1.21
@@ -177,18 +177,15 @@
   const char     *icon_part = NULL;
   OD_Icon        *ret = (OD_Icon *) malloc(sizeof(OD_Icon));
   char            path[PATH_MAX];
-  Evas_Object    *pic = NULL;
 
-  ret->name = strdup(name);
-  ret->scale = 0.0;
-  Evas_Object    *icon = ret->icon = edje_object_add(evas);
+  Evas_Object    *icon   = NULL;
+  Evas_Object    *pic = NULL;
   Evas_Object    *tt_txt = NULL;
   Evas_Object    *tt_shd = NULL;
-
-  ret->arrow = NULL;
-  ret->state = 0;
-  ret->appear_timer = NULL;
-
+  
+  memset(ret, 0, sizeof(OD_Icon));
+  ret->name = strdup(name);
+  icon = ret->icon = edje_object_add(evas);
 
   if ((strstr(options.theme, "/")))
     snprintf(path, PATH_MAX, options.theme);
@@ -351,15 +348,19 @@
 void
 od_icon_tt_show(OD_Icon * icon)
 {
-  evas_object_show(icon->tt_txt);
-  evas_object_show(icon->tt_shd);
+  if (icon->tt_txt)
+    evas_object_show(icon->tt_txt);
+  if (icon->tt_shd)
+    evas_object_show(icon->tt_shd);
 }
 
 void
 od_icon_tt_hide(OD_Icon * icon)
 {
-  evas_object_hide(icon->tt_txt);
-  evas_object_hide(icon->tt_shd);
+  if (icon->tt_txt)
+    evas_object_hide(icon->tt_txt);
+  if (icon->tt_shd)
+    evas_object_hide(icon->tt_shd);
 }
 
 void
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/userconfig.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- userconfig.c        10 Apr 2004 20:47:39 -0000      1.1
+++ userconfig.c        21 Apr 2004 04:27:13 -0000      1.2
@@ -55,7 +55,9 @@
     name = (char *) strtok(NULL, "|");
     icon = (char *) strtok(NULL, "|");
 
+#if 0
     printf("line [%s]\n", line);
+#endif
 
     if (class != NULL && name != NULL && icon != NULL) {
       od_icon_mapping_add(class, name, icon);
@@ -102,7 +104,9 @@
     name = (char *) strtok(NULL, "|");
     icon = (char *) strtok(NULL, "|");
 
+#if 0
     printf("line [%s]\n", line);
+#endif
 
     if (exe != NULL && name != NULL && exe[strlen(exe) - 1] != '#') {
       od_dock_add_applnk(od_icon_new_applnk(exe, name));




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to