elementary: switch to the new efl_future_then syntax.
authorCedric BAIL <cedric@osg.samsung.com>
Sat, 8 Dec 2018 00:03:49 +0000 (16:03 -0800)
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>
Thu, 27 Dec 2018 02:34:11 +0000 (11:34 +0900)
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7448

src/lib/elementary/efl_ui_layout.c
src/lib/elementary/efl_ui_list_view.c

index e45905f..e85566d 100644 (file)
@@ -2250,14 +2250,13 @@ typedef struct _Efl_Ui_Layout_Factory_Request Efl_Ui_Layout_Factory_Request;
 struct _Efl_Ui_Layout_Factory_Request
 {
    Efl_Ui_Layout_Factory_Tracking *tracking;
-   Efl_Ui_Layout *obj;
    Efl_Ui_Layout_Data *pd;
    Efl_Ui_Factory *factory;
    const char *name;
 };
 
 static Eina_Value
-_content_created(void *data, const Eina_Value value)
+_content_created(Eo *obj, void *data, const Eina_Value value)
 {
    Efl_Ui_Layout_Factory_Request *request = data;
    Efl_Gfx_Entity *content = NULL;
@@ -2266,17 +2265,17 @@ _content_created(void *data, const Eina_Value value)
    eina_value_get(&value, &content);
 
    // Recycle old content
-   old_content = elm_layout_content_get(request->obj, request->name);
+   old_content = elm_layout_content_get(obj, request->name);
    if (old_content) efl_ui_factory_release(request->factory, old_content);
 
    // Set new content
-   elm_layout_content_set(request->obj, request->name, content);
+   elm_layout_content_set(obj, request->name, content);
 
    return value;
 }
 
 static void
-_clean_request(void *data, const Eina_Future *dead_future EINA_UNUSED)
+_clean_request(Eo *obj EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
 {
    Efl_Ui_Layout_Factory_Request *request = data;
 
@@ -2298,16 +2297,15 @@ _efl_ui_layout_view_model_content_update(Efl_Ui_Layout_Data *pd, Efl_Ui_Layout_F
 
    request->name = eina_stringshare_ref(name);
    request->pd = pd;
-   request->obj = pd->obj;
    request->factory = efl_ref(tracking->factory);
    request->tracking = tracking;
 
    f = efl_ui_view_factory_create_with_event(tracking->factory, pd->connect.model, pd->obj);
-   f = eina_future_then_from_desc(efl_future_then(pd->obj, f),
-                                  eina_future_cb_easy(.success = _content_created,
-                                                      .success_type = EINA_VALUE_TYPE_OBJECT,
-                                                      .data = request,
-                                                      .free = _clean_request));
+   f = efl_future_then(pd->obj, f,
+                       .success = _content_created,
+                       .success_type = EINA_VALUE_TYPE_OBJECT,
+                       .data = request,
+                       .free = _clean_request);
 }
 
 static void
index e07d3e8..a4a9ab9 100644 (file)
@@ -921,16 +921,14 @@ typedef struct _Efl_Ui_List_Vuew_Layout_Item_Tracking Efl_Ui_List_View_Layout_It
 struct _Efl_Ui_List_Vuew_Layout_Item_Tracking
 {
    Efl_Ui_List_View_Layout_Item *item;
-   Eo *obj;
    Efl_Ui_List_View_Data *pd;
 };
 
 static Eina_Value
-_content_created(void *data, const Eina_Value value)
+_content_created(Eo *obj, void *data, const Eina_Value value)
 {
    Efl_Ui_List_View_Layout_Item_Tracking *tracking = data;
    Efl_Ui_List_View_Layout_Item *item = tracking->item;
-   Eo *obj = tracking->obj;
    Efl_Ui_List_View_Item_Event evt;
 
    eina_value_pget(&value, &item->layout);
@@ -956,7 +954,7 @@ _content_created(void *data, const Eina_Value value)
 }
 
 static void
-_clean_request(void *data, const Eina_Future *dead_future EINA_UNUSED)
+_clean_request(Eo *obj EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
 {
    Efl_Ui_List_View_Layout_Item_Tracking *tracking = data;
 
@@ -978,16 +976,14 @@ _efl_ui_list_view_efl_ui_list_view_model_realize(Eo *obj, Efl_Ui_List_View_Data
    if (!tracking) return item;
 
    tracking->item = item;
-   tracking->obj = obj;
    tracking->pd = pd;
 
    item->layout_request = efl_ui_view_factory_create_with_event(pd->factory, item->children, obj);
-   item->layout_request = efl_future_then(obj, item->layout_request);
-   item->layout_request = eina_future_then_from_desc(item->layout_request,
-                                                     eina_future_cb_easy(.success = _content_created,
-                                                                         .success_type = EINA_VALUE_TYPE_OBJECT,
-                                                                         .data = tracking,
-                                                                         .free = _clean_request));
+   item->layout_request = efl_future_then(obj, item->layout_request,
+                                          .success = _content_created,
+                                          .success_type = EINA_VALUE_TYPE_OBJECT,
+                                          .data = tracking,
+                                          .free = _clean_request);
 
    return item;
 }