summaryrefslogtreecommitdiff
path: root/src/lib/eldbus
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-11-22 17:14:51 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-11-30 14:58:22 -0800
commitf9958821e95952b7bb70ec9f716890a95f88e30d (patch)
tree6b10b96ea6b744fbbf2cb5753c3f760b85a5ef94 /src/lib/eldbus
parent221600ea101fc5a0466a9bba9276350e53844564 (diff)
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
Diffstat (limited to 'src/lib/eldbus')
-rw-r--r--src/lib/eldbus/eldbus_model.c4
-rw-r--r--src/lib/eldbus/eldbus_model_arguments.c4
-rw-r--r--src/lib/eldbus/eldbus_model_connection.c2
-rw-r--r--src/lib/eldbus/eldbus_model_object.c2
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.c4
5 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/eldbus/eldbus_model.c b/src/lib/eldbus/eldbus_model.c
index 3a2115e..ff37b60 100644
--- a/src/lib/eldbus/eldbus_model.c
+++ b/src/lib/eldbus/eldbus_model.c
@@ -123,7 +123,7 @@ _eldbus_model_efl_model_property_set(Eo *obj,
123 123
124 if (strcmp(property, UNIQUE_NAME_PROPERTY)) 124 if (strcmp(property, UNIQUE_NAME_PROPERTY))
125 err = EFL_MODEL_ERROR_NOT_FOUND; 125 err = EFL_MODEL_ERROR_NOT_FOUND;
126 return eina_future_rejected(efl_loop_future_scheduler_get(obj), err); 126 return efl_loop_future_rejected(obj, err);
127} 127}
128 128
129static Eina_Value * 129static Eina_Value *
@@ -181,7 +181,7 @@ _eldbus_model_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
181 unsigned int start EINA_UNUSED, 181 unsigned int start EINA_UNUSED,
182 unsigned int count EINA_UNUSED) 182 unsigned int count EINA_UNUSED)
183{ 183{
184 return eina_future_rejected(efl_loop_future_scheduler_get(obj), 184 return efl_loop_future_rejected(obj,
185 EFL_MODEL_ERROR_NOT_SUPPORTED); 185 EFL_MODEL_ERROR_NOT_SUPPORTED);
186} 186}
187 187
diff --git a/src/lib/eldbus/eldbus_model_arguments.c b/src/lib/eldbus/eldbus_model_arguments.c
index 3781391..f5ee2ac 100644
--- a/src/lib/eldbus/eldbus_model_arguments.c
+++ b/src/lib/eldbus/eldbus_model_arguments.c
@@ -143,11 +143,11 @@ _eldbus_model_arguments_efl_model_property_set(Eo *obj,
143 eina_value_flush(prop_value); 143 eina_value_flush(prop_value);
144 eina_value_copy(value, prop_value); 144 eina_value_copy(value, prop_value);
145 145
146 return eina_future_resolved(efl_loop_future_scheduler_get(obj), 146 return efl_loop_future_resolved(obj,
147 eina_value_reference_copy(value)); 147 eina_value_reference_copy(value));
148 148
149 on_error: 149 on_error:
150 return eina_future_rejected(efl_loop_future_scheduler_get(obj), err); 150 return efl_loop_future_rejected(obj, err);
151} 151}
152 152
153static Eina_Value * 153static Eina_Value *
diff --git a/src/lib/eldbus/eldbus_model_connection.c b/src/lib/eldbus/eldbus_model_connection.c
index c58faaf..175afcd 100644
--- a/src/lib/eldbus/eldbus_model_connection.c
+++ b/src/lib/eldbus/eldbus_model_connection.c
@@ -67,7 +67,7 @@ _eldbus_model_connection_efl_model_children_slice_get(Eo *obj,
67 Eina_Value v; 67 Eina_Value v;
68 68
69 v = efl_model_list_value_get(pd->childrens, start, count); 69 v = efl_model_list_value_get(pd->childrens, start, count);
70 return eina_future_resolved(efl_loop_future_scheduler_get(obj), v); 70 return efl_loop_future_resolved(obj, v);
71 } 71 }
72 72
73 p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL); 73 p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL);
diff --git a/src/lib/eldbus/eldbus_model_object.c b/src/lib/eldbus/eldbus_model_object.c
index f910683..3759fc3 100644
--- a/src/lib/eldbus/eldbus_model_object.c
+++ b/src/lib/eldbus/eldbus_model_object.c
@@ -124,7 +124,7 @@ _eldbus_model_object_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
124 Eina_Value v; 124 Eina_Value v;
125 125
126 v = efl_model_list_value_get(pd->childrens, start, count); 126 v = efl_model_list_value_get(pd->childrens, start, count);
127 return eina_future_resolved(efl_loop_future_scheduler_get(obj), v); 127 return efl_loop_future_resolved(obj, v);
128 } 128 }
129 129
130 p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL); 130 p = efl_loop_promise_new(obj, _eldbus_eina_promise_cancel, NULL);
diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c
index 073baef..4da54ad 100644
--- a/src/lib/eldbus/eldbus_model_proxy.c
+++ b/src/lib/eldbus/eldbus_model_proxy.c
@@ -312,7 +312,7 @@ _eldbus_model_proxy_efl_model_property_set(Eo *obj EINA_UNUSED,
312 return efl_future_then(obj, eina_future_new(data->promise)); 312 return efl_future_then(obj, eina_future_new(data->promise));
313 313
314 on_error: 314 on_error:
315 return eina_future_rejected(efl_loop_future_scheduler_get(obj), err); 315 return efl_loop_future_rejected(obj, err);
316} 316}
317 317
318static Eina_Value * 318static Eina_Value *
@@ -380,7 +380,7 @@ _eldbus_model_proxy_efl_model_children_slice_get(Eo *obj EINA_UNUSED,
380 _eldbus_model_proxy_listed(pd); 380 _eldbus_model_proxy_listed(pd);
381 381
382 v = efl_model_list_value_get(pd->childrens, start, count); 382 v = efl_model_list_value_get(pd->childrens, start, count);
383 return eina_future_resolved(efl_loop_future_scheduler_get(obj), v); 383 return efl_loop_future_resolved(obj, v);
384} 384}
385 385
386static unsigned int 386static unsigned int