Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/bin/tests/combo


Modified Files:
        ewl_combo.c 


Log Message:
- keep the test from crashing if there are no icons installed

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/bin/tests/combo/ewl_combo.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_combo.c 29 Jun 2007 14:48:55 -0000      1.15
+++ ewl_combo.c 19 Aug 2007 05:33:50 -0000      1.16
@@ -232,8 +232,12 @@
        data->data = calloc(data->count, sizeof(char *));
 
        for (i = 0; i < data->count; i++)
-               data->data[i] = strdup(ewl_icon_theme_icon_path_get(icons[i],
-                                               EWL_ICON_SIZE_MEDIUM));
+       {
+               const char *icon;
+
+               icon = ewl_icon_theme_icon_path_get(icons[i], 
EWL_ICON_SIZE_MEDIUM); 
+               data->data[i] = strdup((icon ? icon : icons[i]));
+       }
 
        return data;
 }
@@ -339,6 +343,7 @@
 {
        Ewl_Widget *w;
        Ewl_Widget *o;
+       char *str;
 
        w = ewl_hbox_new();
        ewl_object_alignment_set(EWL_OBJECT(w), EWL_FLAG_ALIGN_LEFT);
@@ -349,7 +354,8 @@
        ewl_widget_show(o);
 
        o = ewl_label_new();
-       ewl_label_text_set(EWL_LABEL(o), strrchr((const char *)data, '/') + 1);
+       str = strrchr((const char *)data, '/');
+       ewl_label_text_set(EWL_LABEL(o), (str ? str + 1 : data));
        ewl_container_child_append(EWL_CONTAINER(w), o);
        ewl_widget_show(o);
 
@@ -362,6 +368,4 @@
 {
        printf("value changed to (%s)\n", ewl_text_text_get(EWL_TEXT(w)));
 }
-
-
 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to