forked from enlightenment/efl
eldbus: simplify code by using helper that create future directly.
The new helper help replace call to eina_future_resolved and eina_future_rejected with a scheduler lookup to just one function call. Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D7340
This commit is contained in:
parent
6600a035c6
commit
29faf24a1d
|
@ -123,7 +123,7 @@ _eldbus_model_efl_model_property_set(Eo *obj,
|
|||
|
||||
if (strcmp(property, UNIQUE_NAME_PROPERTY))
|
||||
err = EFL_MODEL_ERROR_NOT_FOUND;
|
||||
return eina_future_rejected(efl_loop_future_scheduler_get(obj), err);
|
||||
return efl_loop_future_rejected(obj, err);
|
||||
}
|
||||
|
||||
static Eina_Value *
|
||||
|
@ -181,7 +181,7 @@ _eldbus_model_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
|
|||
unsigned int start EINA_UNUSED,
|
||||
unsigned int count EINA_UNUSED)
|
||||
{
|
||||
return eina_future_rejected(efl_loop_future_scheduler_get(obj),
|
||||
return efl_loop_future_rejected(obj,
|
||||
EFL_MODEL_ERROR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
|
|
|
@ -143,11 +143,11 @@ _eldbus_model_arguments_efl_model_property_set(Eo *obj,
|
|||
eina_value_flush(prop_value);
|
||||
eina_value_copy(value, prop_value);
|
||||
|
||||
return eina_future_resolved(efl_loop_future_scheduler_get(obj),
|
||||
return efl_loop_future_resolved(obj,
|
||||
eina_value_reference_copy(value));
|
||||
|
||||
on_error:
|
||||
return eina_future_rejected(efl_loop_future_scheduler_get(obj), err);
|
||||
return efl_loop_future_rejected(obj, err);
|
||||
}
|
||||
|
||||
static Eina_Value *
|
||||
|
|
|
@ -67,7 +67,7 @@ _eldbus_model_connection_efl_model_children_slice_get(Eo *obj,
|
|||
Eina_Value v;
|
||||
|
||||
v = efl_model_list_value_get(pd->childrens, start, count);
|
||||
return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
|
||||
return efl_loop_future_resolved(obj, v);
|
||||
}
|
||||
|
||||
p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL);
|
||||
|
|
|
@ -124,7 +124,7 @@ _eldbus_model_object_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
|
|||
Eina_Value v;
|
||||
|
||||
v = efl_model_list_value_get(pd->childrens, start, count);
|
||||
return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
|
||||
return efl_loop_future_resolved(obj, v);
|
||||
}
|
||||
|
||||
p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL);
|
||||
|
|
|
@ -312,7 +312,7 @@ _eldbus_model_proxy_efl_model_property_set(Eo *obj EINA_UNUSED,
|
|||
return efl_future_then(obj, eina_future_new(data->promise));
|
||||
|
||||
on_error:
|
||||
return eina_future_rejected(efl_loop_future_scheduler_get(obj), err);
|
||||
return efl_loop_future_rejected(obj, err);
|
||||
}
|
||||
|
||||
static Eina_Value *
|
||||
|
@ -380,7 +380,7 @@ _eldbus_model_proxy_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
|
|||
_eldbus_model_proxy_listed(pd);
|
||||
|
||||
v = efl_model_list_value_get(pd->childrens, start, count);
|
||||
return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
|
||||
return efl_loop_future_resolved(obj, v);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
|
|
Loading…
Reference in New Issue