summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/edje_externals/elm_icon.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-06-17 14:53:37 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-06-17 15:59:19 +0200
commitb592c6df35cc23dbc297ee108c61f23e2e701868 (patch)
tree35b2b627e8dc995e502712d2fcecd23c85f44350 /legacy/elementary/src/edje_externals/elm_icon.c
parent6d03b2af7e710dc1fb5090955bcba2465ef86a30 (diff)
elm_icon_external: cleanup ERR msg in error case
Summary: Setting the group without checking it exists causes a errormessage, this is pretty annoying for people which want to set a standart icon. And give a better errormessage if the standart setting failed. Reviewers: raster, cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D2686 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'legacy/elementary/src/edje_externals/elm_icon.c')
-rw-r--r--legacy/elementary/src/edje_externals/elm_icon.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/legacy/elementary/src/edje_externals/elm_icon.c b/legacy/elementary/src/edje_externals/elm_icon.c
index 1ac65b5..979cc0b 100644
--- a/legacy/elementary/src/edje_externals/elm_icon.c
+++ b/legacy/elementary/src/edje_externals/elm_icon.c
@@ -84,8 +84,16 @@ external_icon_state_set(void *data EINA_UNUSED, Evas_Object *obj,
84 edje = evas_object_smart_parent_get(obj); 84 edje = evas_object_smart_parent_get(obj);
85 edje_object_file_get(edje, &file, NULL); 85 edje_object_file_get(edje, &file, NULL);
86 86
87 if (!elm_image_file_set(obj, file, p->icon)) 87 if (!edje_file_group_exists(file, p->icon))
88 elm_icon_standard_set(obj, p->icon); 88 {
89 if (!elm_icon_standard_set(obj, p->icon))
90 ERR("Failed to set standard icon! (%s)", p->icon);
91 }
92 else if (!elm_image_file_set(obj, file, p->icon))
93 {
94 if (!elm_icon_standard_set(obj, p->icon))
95 ERR("Failed to set standard icon! (%s)", p->icon);
96 }
89 } 97 }
90} 98}
91 99
@@ -153,8 +161,16 @@ external_icon_param_set(void *data EINA_UNUSED, Evas_Object *obj,
153 edje = evas_object_smart_parent_get(obj); 161 edje = evas_object_smart_parent_get(obj);
154 edje_object_file_get(edje, &file, NULL); 162 edje_object_file_get(edje, &file, NULL);
155 163
156 if (!elm_image_file_set(obj, file, param->s)) 164 if (!edje_file_group_exists(file, param->s))
157 elm_icon_standard_set(obj, param->s); 165 {
166 if (!elm_icon_standard_set(obj, param->s))
167 ERR("Failed to set standard icon! (%s)", param->s);
168 }
169 else if (!elm_image_file_set(obj, file, param->s))
170 {
171 if (!elm_icon_standard_set(obj, param->s))
172 ERR("Failed to set standard icon as fallback! (%s)", param->s);
173 }
158 return EINA_TRUE; 174 return EINA_TRUE;
159 } 175 }
160 } 176 }