summaryrefslogtreecommitdiff
path: root/src/lib/eldbus
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-11-22 16:45:03 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-11-30 14:58:10 -0800
commit6a8d4d8159f5744ad72e5fb5c69d22c9c3e0e8d0 (patch)
treec0946b56318b9d58a7bc707446ed0f7b78604339 /src/lib/eldbus
parent959024ae8022819c03dd7b67f801865b72c0ea4d (diff)
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
Diffstat (limited to 'src/lib/eldbus')
-rw-r--r--src/lib/eldbus/eldbus_model_connection.c3
-rw-r--r--src/lib/eldbus/eldbus_model_object.c3
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.c3
3 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/eldbus/eldbus_model_connection.c b/src/lib/eldbus/eldbus_model_connection.c
index a2ed5d5..c58faaf 100644
--- a/src/lib/eldbus/eldbus_model_connection.c
+++ b/src/lib/eldbus/eldbus_model_connection.c
@@ -70,8 +70,7 @@ _eldbus_model_connection_efl_model_children_slice_get(Eo *obj,
70 return eina_future_resolved(efl_loop_future_scheduler_get(obj), v); 70 return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
71 } 71 }
72 72
73 p = eina_promise_new(efl_loop_future_scheduler_get(obj), 73 p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL);
74 _eldbus_eina_promise_cancel, NULL);
75 74
76 slice = calloc(1, sizeof (Eldbus_Children_Slice_Promise)); 75 slice = calloc(1, sizeof (Eldbus_Children_Slice_Promise));
77 slice->p = p; 76 slice->p = p;
diff --git a/src/lib/eldbus/eldbus_model_object.c b/src/lib/eldbus/eldbus_model_object.c
index ece21cf..f910683 100644
--- a/src/lib/eldbus/eldbus_model_object.c
+++ b/src/lib/eldbus/eldbus_model_object.c
@@ -127,8 +127,7 @@ _eldbus_model_object_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
127 return eina_future_resolved(efl_loop_future_scheduler_get(obj), v); 127 return eina_future_resolved(efl_loop_future_scheduler_get(obj), v);
128 } 128 }
129 129
130 p = eina_promise_new(efl_loop_future_scheduler_get(obj), 130 p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL);
131 _eldbus_eina_promise_cancel, NULL);
132 131
133 slice = calloc(1, sizeof(struct _Eldbus_Children_Slice_Promise)); 132 slice = calloc(1, sizeof(struct _Eldbus_Children_Slice_Promise));
134 slice->p = p; 133 slice->p = p;
diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c
index 96505ca..073baef 100644
--- a/src/lib/eldbus/eldbus_model_proxy.c
+++ b/src/lib/eldbus/eldbus_model_proxy.c
@@ -293,8 +293,7 @@ _eldbus_model_proxy_efl_model_property_set(Eo *obj EINA_UNUSED,
293 if (!data) goto on_error; 293 if (!data) goto on_error;
294 294
295 data->pd = pd; 295 data->pd = pd;
296 data->promise = eina_promise_new(efl_loop_future_scheduler_get(obj), 296 data->promise = efl_loop_promise_new(obj, _eldbus_model_proxy_cancel_cb, data);
297 _eldbus_model_proxy_cancel_cb, data);
298 data->property = eina_stringshare_add(property); 297 data->property = eina_stringshare_add(property);
299 if (!(data->value = eina_value_dup(value))) goto on_error; 298 if (!(data->value = eina_value_dup(value))) goto on_error;
300 299