summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-02-11 16:31:52 -0800
committerCedric BAIL <cedric.bail@free.fr>2019-02-21 11:54:09 -0800
commitb23f65291f9624827e40ebf32d5133cb1074aeb6 (patch)
tree34f7287c424413a2bf5debb2ff8601e6c7d1e00a /src/lib/eo/eo.c
parent56a91961ce07337fb9e73f46298415426175d25a (diff)
eo: make reflection setter able to return an error code in case of failure.
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de> Differential Revision: https://phab.enlightenment.org/D7935
Diffstat (limited to 'src/lib/eo/eo.c')
-rw-r--r--src/lib/eo/eo.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index c2b5f85..efd6805 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -3636,20 +3636,25 @@ _efl_class_reflection_find(const _Efl_Class *klass, const char *property_name)
3636 return NULL; 3636 return NULL;
3637} 3637}
3638 3638
3639EAPI void 3639EAPI Eina_Error
3640efl_property_reflection_set(Eo *obj_id, const char *property_name, Eina_Value value) 3640efl_property_reflection_set(Eo *obj_id, const char *property_name, Eina_Value value)
3641{ 3641{
3642 Eina_Error r = EINA_ERROR_NOT_IMPLEMENTED;
3643 Eina_Bool freed = EINA_FALSE;
3644
3642 EO_OBJ_POINTER_GOTO(obj_id, obj, end); 3645 EO_OBJ_POINTER_GOTO(obj_id, obj, end);
3643 const Efl_Object_Property_Reflection *reflection = _efl_class_reflection_find(obj->klass, property_name); 3646 const Efl_Object_Property_Reflection *reflection = _efl_class_reflection_find(obj->klass, property_name);
3644 3647
3645 if (!reflection || !reflection->set) goto end; 3648 if (reflection && reflection->set)
3649 {
3650 r = reflection->set(obj_id, value);
3651 freed = EINA_TRUE;
3652 }
3646 3653
3647 reflection->set(obj_id, value); 3654 end:
3648 EO_OBJ_DONE(obj_id); 3655 if (!freed) eina_value_flush(&value);
3649 return;
3650end:
3651 eina_value_flush(&value);
3652 EO_OBJ_DONE(obj_id); 3656 EO_OBJ_DONE(obj_id);
3657 return r;
3653} 3658}
3654 3659
3655EAPI Eina_Value 3660EAPI Eina_Value