efl_ui_layout_object: fix warnings
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Mon, 25 Jun 2018 10:56:09 +0000 (06:56 -0400)
committerWonki Kim <wonki_.kim@samsung.com>
Wed, 27 Jun 2018 07:54:55 +0000 (16:54 +0900)
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

src/lib/elementary/efl_ui_layout_object.c

index 2bffbff..16d0325 100644 (file)
@@ -2153,6 +2153,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)
      {
@@ -2162,7 +2171,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);
      }