eldbus: simplify code by using proper helper.

efl_loop_promise_new is a helper function that does automatically figure out an
available scheduler and create a promise from it. Basically replacing the call to
eina_promise_new(efl_loop_future_scheduler_get(o), ...).

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7335
This commit is contained in:
Cedric BAIL 2018-11-22 16:45:03 -08:00 committed by Christopher Michael
parent d20d5021de
commit 76cffceb2e
3 changed files with 3 additions and 6 deletions

View File

@ -70,8 +70,7 @@ _eldbus_model_connection_efl_model_children_slice_get(Eo *obj,
return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
}
p = eina_promise_new(efl_loop_future_scheduler_get(obj),
_eldbus_eina_promise_cancel, NULL);
p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL);
slice = calloc(1, sizeof (Eldbus_Children_Slice_Promise));
slice->p = p;

View File

@ -127,8 +127,7 @@ _eldbus_model_object_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
}
p = eina_promise_new(efl_loop_future_scheduler_get(obj),
_eldbus_eina_promise_cancel, NULL);
p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL);
slice = calloc(1, sizeof(struct _Eldbus_Children_Slice_Promise));
slice->p = p;

View File

@ -293,8 +293,7 @@ _eldbus_model_proxy_efl_model_property_set(Eo *obj EINA_UNUSED,
if (!data) goto on_error;
data->pd = pd;
data->promise = eina_promise_new(efl_loop_future_scheduler_get(obj),
_eldbus_model_proxy_cancel_cb, data);
data->promise = efl_loop_promise_new(obj, _eldbus_model_proxy_cancel_cb, data);
data->property = eina_stringshare_add(property);
if (!(data->value = eina_value_dup(value))) goto on_error;