summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-11-22 16:44:12 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-11-30 14:58:05 -0800
commitbf445d2476168ea57433c01a9a3f6107c87dc782 (patch)
tree43be703619a03529e86df9750575c362d75d01b9 /src/lib/ecore_con
parent98b716d0fa745fe5aa4d110615bf0dd90f695ddb (diff)
ecore_con: 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/D7333
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/efl_net_control_access_point-connman.c3
-rw-r--r--src/lib/ecore_con/efl_net_control_technology-connman.c3
-rw-r--r--src/lib/ecore_con/efl_net_ip_address.c2
3 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/ecore_con/efl_net_control_access_point-connman.c b/src/lib/ecore_con/efl_net_control_access_point-connman.c
index 4dc6768..a54cce2 100644
--- a/src/lib/ecore_con/efl_net_control_access_point-connman.c
+++ b/src/lib/ecore_con/efl_net_control_access_point-connman.c
@@ -773,8 +773,7 @@ _efl_net_control_access_point_connect(Eo *o, Efl_Net_Control_Access_Point_Data *
773 Eina_Promise *promise; 773 Eina_Promise *promise;
774 Eina_Future *f = NULL; 774 Eina_Future *f = NULL;
775 775
776 promise = eina_promise_new(efl_loop_future_scheduler_get(o), 776 promise = efl_loop_promise_new(o, _efl_net_control_access_point_connect_promise_del, o);
777 _efl_net_control_access_point_connect_promise_del, o);
778 EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL); 777 EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL);
779 778
780 f = eina_future_new(promise); 779 f = eina_future_new(promise);
diff --git a/src/lib/ecore_con/efl_net_control_technology-connman.c b/src/lib/ecore_con/efl_net_control_technology-connman.c
index 2389498..92660de 100644
--- a/src/lib/ecore_con/efl_net_control_technology-connman.c
+++ b/src/lib/ecore_con/efl_net_control_technology-connman.c
@@ -399,8 +399,7 @@ _efl_net_control_technology_scan(Eo *o, Efl_Net_Control_Technology_Data *pd)
399 Eina_Promise *promise; 399 Eina_Promise *promise;
400 Eina_Future *f = NULL; 400 Eina_Future *f = NULL;
401 401
402 promise = eina_promise_new(efl_loop_future_scheduler_get(o), 402 promise = efl_loop_promise_new(o, _efl_net_control_technology_scan_promise_del, NULL);
403 _efl_net_control_technology_scan_promise_del, NULL);
404 EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL); 403 EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL);
405 404
406 f = eina_future_new(promise); 405 f = eina_future_new(promise);
diff --git a/src/lib/ecore_con/efl_net_ip_address.c b/src/lib/ecore_con/efl_net_ip_address.c
index e2fbb68..276f102 100644
--- a/src/lib/ecore_con/efl_net_ip_address.c
+++ b/src/lib/ecore_con/efl_net_ip_address.c
@@ -572,7 +572,7 @@ _efl_net_ip_address_resolve(Eo *cls EINA_UNUSED, void *pd EINA_UNUSED, const cha
572 ctx->thread = efl_net_ip_resolve_async_new(host, port, &hints, _efl_net_ip_address_resolve_done, ctx); 572 ctx->thread = efl_net_ip_resolve_async_new(host, port, &hints, _efl_net_ip_address_resolve_done, ctx);
573 EINA_SAFETY_ON_NULL_GOTO(ctx->thread, error_thread); 573 EINA_SAFETY_ON_NULL_GOTO(ctx->thread, error_thread);
574 574
575 ctx->promise = eina_promise_new(efl_loop_future_scheduler_get(efl_main_loop_get()), _efl_net_ip_address_resolve_del, ctx); 575 ctx->promise = efl_loop_promise_new(efl_main_loop_get(), _efl_net_ip_address_resolve_del, ctx);
576 EINA_SAFETY_ON_NULL_GOTO(ctx->promise, error_promise); 576 EINA_SAFETY_ON_NULL_GOTO(ctx->promise, error_promise);
577 577
578 free(str); 578 free(str);