From: Cedric BAIL Date: Sat, 8 Dec 2018 00:03:49 +0000 (-0800) Subject: elementary: switch to the new efl_future_then syntax. X-Git-Tag: submit/tizen/20181227.084356~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f9721568a12ce835835e2b848d45c2316df7c3d;p=platform%2Fupstream%2Fefl.git elementary: switch to the new efl_future_then syntax. Reviewed-by: SangHyeon Jade Lee Differential Revision: https://phab.enlightenment.org/D7448 --- diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index e45905f..e85566d 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -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 diff --git a/src/lib/elementary/efl_ui_list_view.c b/src/lib/elementary/efl_ui_list_view.c index e07d3e8..a4a9ab9 100644 --- a/src/lib/elementary/efl_ui_list_view.c +++ b/src/lib/elementary/efl_ui_list_view.c @@ -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; }