efl_ui_layout_object: fix warnings

Summary:
ensure that the signal is correctly composed.
For the case that the eina value is carrying a error, then we just error
out.
Depends on D6378

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6379
This commit is contained in:
Marcel Hollerbach 2018-06-25 06:56:09 -04:00 committed by Mike Blumenkrantz
parent ddeae96421
commit d714c21ecb
1 changed files with 10 additions and 1 deletions

View File

@ -1950,6 +1950,15 @@ _efl_ui_layout_view_model_signal_update(Efl_Ui_Layout_Object_Data *pd, const cha
v = efl_model_property_get(pd->connect.model, fetch);
if (!v) return;
if (eina_value_type_get(v) == EINA_VALUE_TYPE_ERROR)
{
Eina_Error error;
eina_value_get(v, &error);
ERR("Failed to fetch signal value. Error: %s", eina_error_msg_get(error));
return;
}
// FIXME: previous implementation would just do that for signal/part == "selected"
if (eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR)
{
@ -1959,7 +1968,7 @@ _efl_ui_layout_view_model_signal_update(Efl_Ui_Layout_Object_Data *pd, const cha
if (bl) value = strdup("selected");
else value = strdup("unselected");
}
else if (eina_value_type_get(v) != EINA_VALUE_TYPE_ERROR)
else
{
value = eina_value_to_string(v);
}