forked from enlightenment/efl
elementary: switch to the new efl_future_then syntax.
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D7448
This commit is contained in:
parent
50d675d6c1
commit
e74578c7d3
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue