cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e74578c7d3b7e95eb489925efbf860c9b87e938e

commit e74578c7d3b7e95eb489925efbf860c9b87e938e
Author: Cedric BAIL <[email protected]>
Date:   Fri Dec 7 16:03:49 2018 -0800

    elementary: switch to the new efl_future_then syntax.
    
    Reviewed-by: SangHyeon Jade Lee <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D7448
---
 src/lib/elementary/efl_ui_layout.c    | 20 +++++++++-----------
 src/lib/elementary/efl_ui_list_view.c | 18 +++++++-----------
 2 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/src/lib/elementary/efl_ui_layout.c 
b/src/lib/elementary/efl_ui_layout.c
index ea40224af3..deba292ce5 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -2047,14 +2047,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;
@@ -2063,17 +2062,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;
 
@@ -2095,16 +2094,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
diff --git a/src/lib/elementary/efl_ui_list_view.c 
b/src/lib/elementary/efl_ui_list_view.c
index 34c90dd7aa..fc85818fc0 100644
--- a/src/lib/elementary/efl_ui_list_view.c
+++ b/src/lib/elementary/efl_ui_list_view.c
@@ -916,16 +916,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);
@@ -951,7 +949,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;
 
@@ -973,16 +971,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;
 }

-- 


Reply via email to