summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Jr <larry.olj@gmail.com>2016-04-29 19:39:37 -0300
committerLarry Jr <larry.olj@gmail.com>2016-04-29 20:55:37 -0300
commit7bbc5ec6230b779ed8ce7ca73527b83c551688d8 (patch)
tree05a55556da19a6a8f63ed1614adf5a3d4fa57410
parente69f41001baa664b6021362319810e3701e808b5 (diff)
Eldbus: fixed property_set in Eldbus.Model_Proxy
Diffstat (limited to '')
-rw-r--r--src/lib/eldbus/eldbus_model_arguments.c6
-rw-r--r--src/lib/eldbus/eldbus_model_object.c2
-rw-r--r--src/lib/eldbus/eldbus_model_proxy.c187
-rw-r--r--src/lib/eldbus/eldbus_model_proxy_private.h1
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_model.c6
5 files changed, 150 insertions, 52 deletions
diff --git a/src/lib/eldbus/eldbus_model_arguments.c b/src/lib/eldbus/eldbus_model_arguments.c
index d3271f0217..6831f5b0cf 100644
--- a/src/lib/eldbus/eldbus_model_arguments.c
+++ b/src/lib/eldbus/eldbus_model_arguments.c
@@ -152,12 +152,12 @@ _eldbus_model_arguments_efl_model_base_property_get(Eo *obj EINA_UNUSED,
152 152
153 _eldbus_model_arguments_properties_load(pd); 153 _eldbus_model_arguments_properties_load(pd);
154 154
155 Eina_Bool ret = _eldbus_model_arguments_is_output_argument(pd, property);
156 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_PERMISSION_DENIED);
157
158 Eina_Value* value = eina_hash_find(pd->properties_hash, property); 155 Eina_Value* value = eina_hash_find(pd->properties_hash, property);
159 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(value, promise, EFL_MODEL_ERROR_NOT_FOUND); 156 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(value, promise, EFL_MODEL_ERROR_NOT_FOUND);
160 157
158 Eina_Bool ret = _eldbus_model_arguments_is_output_argument(pd, property);
159 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_PERMISSION_DENIED);
160
161 eina_value_copy(value, eina_promise_owner_buffer_get(promise)); 161 eina_value_copy(value, eina_promise_owner_buffer_get(promise));
162 eina_promise_owner_value_set(promise, NULL, (Eina_Promise_Free_Cb)&eina_value_flush); 162 eina_promise_owner_value_set(promise, NULL, (Eina_Promise_Free_Cb)&eina_value_flush);
163} 163}
diff --git a/src/lib/eldbus/eldbus_model_object.c b/src/lib/eldbus/eldbus_model_object.c
index 8791576060..c27d74e5c4 100644
--- a/src/lib/eldbus/eldbus_model_object.c
+++ b/src/lib/eldbus/eldbus_model_object.c
@@ -128,7 +128,7 @@ _eldbus_model_object_efl_model_base_property_set(Eo *obj EINA_UNUSED,
128 Eina_Promise_Owner *promise) 128 Eina_Promise_Owner *promise)
129{ 129{
130 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET((strcmp(property, UNIQUE_NAME_PROPERTY) == 0), promise, EFL_MODEL_ERROR_NOT_FOUND); 130 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET((strcmp(property, UNIQUE_NAME_PROPERTY) == 0), promise, EFL_MODEL_ERROR_NOT_FOUND);
131 eina_promise_owner_error_set(promise, EFL_MODEL_ERROR_NOT_SUPPORTED); 131 eina_promise_owner_error_set(promise, EFL_MODEL_ERROR_READ_ONLY);
132} 132}
133 133
134static void 134static void
diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c
index 0caa4b3e57..16a9f1345c 100644
--- a/src/lib/eldbus/eldbus_model_proxy.c
+++ b/src/lib/eldbus/eldbus_model_proxy.c
@@ -14,16 +14,19 @@ static Eina_Bool _eldbus_model_proxy_load(Eldbus_Model_Proxy_Data *);
14static void _eldbus_model_proxy_unload(Eldbus_Model_Proxy_Data *); 14static void _eldbus_model_proxy_unload(Eldbus_Model_Proxy_Data *);
15static void _eldbus_model_proxy_property_get_all_cb(void *, const Eldbus_Message *, Eldbus_Pending *); 15static void _eldbus_model_proxy_property_get_all_cb(void *, const Eldbus_Message *, Eldbus_Pending *);
16static void _eldbus_model_proxy_property_set_cb(void *, const Eldbus_Message *, Eldbus_Pending *); 16static void _eldbus_model_proxy_property_set_cb(void *, const Eldbus_Message *, Eldbus_Pending *);
17static void _eldbus_model_proxy_property_set_load_cb(void *, const Eldbus_Message *, Eldbus_Pending *);
17static void _eldbus_model_proxy_start_monitor(Eldbus_Model_Proxy_Data *); 18static void _eldbus_model_proxy_start_monitor(Eldbus_Model_Proxy_Data *);
18static void _eldbus_model_proxy_stop_monitor(Eldbus_Model_Proxy_Data *); 19static void _eldbus_model_proxy_stop_monitor(Eldbus_Model_Proxy_Data *);
19static void _eldbus_model_proxy_property_changed_cb(void *, Eldbus_Proxy *, void *); 20static void _eldbus_model_proxy_property_changed_cb(void *, Eldbus_Proxy *, void *);
20static void _eldbus_model_proxy_property_invalidated_cb(void *, Eldbus_Proxy *, void *); 21static void _eldbus_model_proxy_property_invalidated_cb(void *, Eldbus_Proxy *, void *);
21static bool _eldbus_model_proxy_is_property_writeable(Eldbus_Model_Proxy_Data *, const char *); 22static bool _eldbus_model_proxy_is_property_writeable(Eldbus_Model_Proxy_Data *, const char *);
23static bool _eldbus_model_proxy_has_property(Eldbus_Model_Proxy_Data *, const char *);
22static bool _eldbus_model_proxy_is_property_readable(Eldbus_Model_Proxy_Data *, const char *); 24static bool _eldbus_model_proxy_is_property_readable(Eldbus_Model_Proxy_Data *, const char *);
23static const char *_eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *, const char *); 25static const char *_eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *, const char *);
24static void _eldbus_model_proxy_create_methods_children(Eldbus_Model_Proxy_Data *); 26static void _eldbus_model_proxy_create_methods_children(Eldbus_Model_Proxy_Data *);
25static void _eldbus_model_proxy_create_signals_children(Eldbus_Model_Proxy_Data *); 27static void _eldbus_model_proxy_create_signals_children(Eldbus_Model_Proxy_Data *);
26 28
29
27typedef struct _Eldbus_Model_Proxy_Property_Set_Data Eldbus_Model_Proxy_Property_Set_Data; 30typedef struct _Eldbus_Model_Proxy_Property_Set_Data Eldbus_Model_Proxy_Property_Set_Data;
28 31
29struct _Eldbus_Model_Proxy_Property_Set_Data 32struct _Eldbus_Model_Proxy_Property_Set_Data
@@ -31,9 +34,10 @@ struct _Eldbus_Model_Proxy_Property_Set_Data
31 Eldbus_Model_Proxy_Data *pd; 34 Eldbus_Model_Proxy_Data *pd;
32 Eina_Stringshare *property; 35 Eina_Stringshare *property;
33 Eina_Value value; 36 Eina_Value value;
37 Eina_Promise_Owner *promise;
34}; 38};
35 39
36static Eldbus_Model_Proxy_Property_Set_Data * _eldbus_model_proxy_property_set_data_new(Eldbus_Model_Proxy_Data *, const char *, const Eina_Value *); 40static Eldbus_Model_Proxy_Property_Set_Data * _eldbus_model_proxy_property_set_data_new(Eldbus_Model_Proxy_Data *, const char *, const Eina_Value *, Eina_Promise_Owner *promise);
37static void _eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data *); 41static void _eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data *);
38 42
39static void 43static void
@@ -118,16 +122,36 @@ _eldbus_model_proxy_efl_model_base_property_set(Eo *obj EINA_UNUSED,
118 ret = _eldbus_model_proxy_load(pd); 122 ret = _eldbus_model_proxy_load(pd);
119 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_INIT_FAILED); 123 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_INIT_FAILED);
120 124
125 ret = _eldbus_model_proxy_has_property(pd, property);
126 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_NOT_FOUND);
127
121 ret = _eldbus_model_proxy_is_property_writeable(pd, property); 128 ret = _eldbus_model_proxy_is_property_writeable(pd, property);
122 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_READ_ONLY); 129 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_READ_ONLY);
123 130
124 data = _eldbus_model_proxy_property_set_data_new(pd, property, value);
125 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(data, promise, EFL_MODEL_ERROR_UNKNOWN);
126
127 signature = _eldbus_model_proxy_property_type_get(pd, property); 131 signature = _eldbus_model_proxy_property_type_get(pd, property);
132 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(signature, promise, EFL_MODEL_ERROR_UNKNOWN);
133
134 data = _eldbus_model_proxy_property_set_data_new(pd, property, value, promise);
128 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(data, promise, EFL_MODEL_ERROR_UNKNOWN); 135 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(data, promise, EFL_MODEL_ERROR_UNKNOWN);
129 136
130 pd->promises_set = eina_list_append(pd->promises_set, promise); 137 if (!pd->is_loaded)
138 {
139 Eldbus_Pending *pending;
140 _Eldbus_Property_Promise *p = calloc(1, sizeof(_Eldbus_Property_Promise));
141 EINA_SAFETY_ON_NULL_RETURN(p);
142
143 p->promise = promise;
144 p->property = strdup(property);
145 pd->promise_list = eina_list_append(pd->promise_list, p);
146
147 if (!pd->pending_list)
148 {
149 pending = eldbus_proxy_property_get_all(pd->proxy, _eldbus_model_proxy_property_set_load_cb, data);
150 pd->pending_list = eina_list_append(pd->pending_list, pending);
151 }
152 return;
153 }
154
131 pending = eldbus_proxy_property_value_set 155 pending = eldbus_proxy_property_value_set
132 (pd->proxy, property, signature, (Eina_Value*)value, _eldbus_model_proxy_property_set_cb, data); 156 (pd->proxy, property, signature, (Eina_Value*)value, _eldbus_model_proxy_property_set_cb, data);
133 pd->pending_list = eina_list_append(pd->pending_list, pending); 157 pd->pending_list = eina_list_append(pd->pending_list, pending);
@@ -147,6 +171,9 @@ _eldbus_model_proxy_efl_model_base_property_get(Eo *obj EINA_UNUSED,
147 ret = _eldbus_model_proxy_load(pd); 171 ret = _eldbus_model_proxy_load(pd);
148 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_INIT_FAILED); 172 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_INIT_FAILED);
149 173
174 ret = _eldbus_model_proxy_has_property(pd, property);
175 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_NOT_FOUND);
176
150 if (!pd->is_loaded) 177 if (!pd->is_loaded)
151 { 178 {
152 Eldbus_Pending *pending; 179 Eldbus_Pending *pending;
@@ -166,7 +193,7 @@ _eldbus_model_proxy_efl_model_base_property_get(Eo *obj EINA_UNUSED,
166 } 193 }
167 194
168 Eina_Value* value = eina_hash_find(pd->properties_hash, property); 195 Eina_Value* value = eina_hash_find(pd->properties_hash, property);
169 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_NOT_FOUND); 196 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(value, promise, EFL_MODEL_ERROR_NOT_FOUND);
170 197
171 ret = _eldbus_model_proxy_is_property_writeable(pd, property); 198 ret = _eldbus_model_proxy_is_property_writeable(pd, property);
172 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_READ_ONLY); 199 ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(ret, promise, EFL_MODEL_ERROR_READ_ONLY);
@@ -450,39 +477,26 @@ _eldbus_model_proxy_property_invalidated_cb(void *data,
450 efl_model_property_invalidated_notify(pd->obj, event->name); 477 efl_model_property_invalidated_notify(pd->obj, event->name);
451} 478}
452 479
453static void 480static Eina_Array *
454_eldbus_model_proxy_property_get_all_cb(void *data, 481_eldbus_model_proxy_property_get_all_load(const Eldbus_Message *msg, Eldbus_Model_Proxy_Data *pd)
455 const Eldbus_Message *msg,
456 Eldbus_Pending *pending)
457{ 482{
458 Eldbus_Model_Proxy_Data *pd = (Eldbus_Model_Proxy_Data*)data;
459 Eldbus_Introspection_Property *prop; 483 Eldbus_Introspection_Property *prop;
460 Eina_Array *changed_properties;
461 Eldbus_Message_Iter *values = NULL; 484 Eldbus_Message_Iter *values = NULL;
462 Eldbus_Message_Iter *entry; 485 Eldbus_Message_Iter *entry;
486 Eina_Array *changed_properties;
463 Eina_List *it; 487 Eina_List *it;
464 const char *error_name, *error_text; 488 const char *error_name, *error_text;
465 489
466 pd->pending_list = eina_list_remove(pd->pending_list, pending);
467
468 if (eldbus_message_error_get(msg, &error_name, &error_text)) 490 if (eldbus_message_error_get(msg, &error_name, &error_text))
469 { 491 {
470 ERR("%s: %s", error_name, error_text); 492 ERR("%s: %s", error_name, error_text);
471 Eina_List* i; 493 return NULL;
472 _Eldbus_Property_Promise* p;
473 EINA_LIST_FOREACH(pd->promise_list, i, p)
474 {
475 eina_promise_owner_error_set(p->promise, EFL_MODEL_ERROR_UNKNOWN);
476 free(p->property);
477 }
478 eina_list_free(pd->promise_list);
479 return;
480 } 494 }
481 495
482 if (!eldbus_message_arguments_get(msg, "a{sv}", &values)) 496 if (!eldbus_message_arguments_get(msg, "a{sv}", &values))
483 { 497 {
484 ERR("%s", "Error getting arguments."); 498 ERR("%s", "Error getting arguments.");
485 return; 499 return NULL;
486 } 500 }
487 501
488 EINA_LIST_FOREACH(pd->interface->properties, it, prop) 502 EINA_LIST_FOREACH(pd->interface->properties, it, prop)
@@ -529,13 +543,48 @@ _eldbus_model_proxy_property_get_all_cb(void *data,
529 } 543 }
530 544
531 pd->is_loaded = EINA_TRUE; 545 pd->is_loaded = EINA_TRUE;
546 return changed_properties;
547
548 on_error:
549 eina_array_free(changed_properties);
550 return NULL;
551}
552
553static void
554_eldbus_model_proxy_property_get_all_cb(void *data,
555 const Eldbus_Message *msg,
556 Eldbus_Pending *pending)
557{
558 Eldbus_Model_Proxy_Data *pd = (Eldbus_Model_Proxy_Data*)data;
559
560 pd->pending_list = eina_list_remove(pd->pending_list, pending);
561 Eina_Array *changed_properties = _eldbus_model_proxy_property_get_all_load(msg, pd);
562 if (changed_properties == NULL)
563 {
564 Eina_List* i;
565 _Eldbus_Property_Promise* p;
566 EINA_LIST_FOREACH(pd->promise_list, i, p)
567 {
568 eina_promise_owner_error_set(p->promise, EFL_MODEL_ERROR_NOT_FOUND);
569 free(p->property);
570 }
571 eina_list_free(pd->promise_list);
572 return;
573 }
532 574
533 Eina_List* i; 575 Eina_List* i;
534 _Eldbus_Property_Promise* p; 576 _Eldbus_Property_Promise* p;
535 EINA_LIST_FOREACH(pd->promise_list, i, p) 577 EINA_LIST_FOREACH(pd->promise_list, i, p)
536 { 578 {
537 Eina_Value* value = eina_hash_find(pd->properties_hash, p->property); 579 Eina_Value* value = eina_hash_find(pd->properties_hash, p->property);
538 if (!value || !_eldbus_model_proxy_is_property_readable(pd, p->property)) 580 if (!value)
581 {
582 eina_promise_owner_error_set(p->promise, EFL_MODEL_ERROR_NOT_FOUND);
583 free(p->property);
584 continue;
585 }
586
587 if (!_eldbus_model_proxy_is_property_readable(pd, p->property))
539 { 588 {
540 eina_promise_owner_error_set(p->promise, EFL_MODEL_ERROR_READ_ONLY); 589 eina_promise_owner_error_set(p->promise, EFL_MODEL_ERROR_READ_ONLY);
541 free(p->property); 590 free(p->property);
@@ -561,12 +610,40 @@ _eldbus_model_proxy_property_get_all_cb(void *data,
561 eo_event_callback_call(pd->obj, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, &evt); 610 eo_event_callback_call(pd->obj, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, &evt);
562 } 611 }
563 612
564 on_error:
565 eina_array_free(changed_properties); 613 eina_array_free(changed_properties);
566} 614}
567 615
568 616
569static void 617static void
618_eldbus_model_proxy_property_set_load_cb(void *data,
619 const Eldbus_Message *msg,
620 Eldbus_Pending *pending)
621{
622 Eldbus_Model_Proxy_Property_Set_Data *set_data = (Eldbus_Model_Proxy_Property_Set_Data *)data;
623 Eldbus_Model_Proxy_Data *pd = set_data->pd;
624 const char *signature;
625
626 pd->pending_list = eina_list_remove(pd->pending_list, pending);
627 signature = _eldbus_model_proxy_property_type_get(pd, set_data->property);
628
629 Eina_Array *changed_properties = _eldbus_model_proxy_property_get_all_load(msg, pd);
630 if (signature == NULL || changed_properties == NULL)
631 {
632 eina_promise_owner_error_set(set_data->promise, EFL_MODEL_ERROR_UNKNOWN);
633
634 eina_array_free(changed_properties);
635 _eldbus_model_proxy_property_set_data_free(set_data);
636 return;
637 }
638
639 eina_array_free(changed_properties);
640 pending = eldbus_proxy_property_value_set
641 (pd->proxy, set_data->property, signature, &set_data->value, _eldbus_model_proxy_property_set_cb, set_data);
642 pd->pending_list = eina_list_append(pd->pending_list, pending);
643}
644
645
646static void
570_eldbus_model_proxy_property_set_cb(void *data, 647_eldbus_model_proxy_property_set_cb(void *data,
571 const Eldbus_Message *msg, 648 const Eldbus_Message *msg,
572 Eldbus_Pending *pending) 649 Eldbus_Pending *pending)
@@ -575,34 +652,53 @@ _eldbus_model_proxy_property_set_cb(void *data,
575 Eldbus_Model_Proxy_Data *pd = property_set_data->pd; 652 Eldbus_Model_Proxy_Data *pd = property_set_data->pd;
576 const char *error_name, *error_text; 653 const char *error_name, *error_text;
577 Eina_Value *prop_value; 654 Eina_Value *prop_value;
578 Eina_Bool ret;
579 655
580 pd->pending_list = eina_list_remove(pd->pending_list, pending); 656 pd->pending_list = eina_list_remove(pd->pending_list, pending);
581 657
582 if (eldbus_message_error_get(msg, &error_name, &error_text)) 658 if (eldbus_message_error_get(msg, &error_name, &error_text))
583 { 659 {
584 ERR("%s: %s", error_name, error_text); 660 ERR("%s: %s", error_name, error_text);
585 goto on_error; 661 eina_promise_owner_error_set(property_set_data->promise, EFL_MODEL_ERROR_UNKNOWN);
662 _eldbus_model_proxy_property_set_data_free(property_set_data);
663 return;
586 } 664 }
587 665
588 prop_value = eina_hash_find(pd->properties_hash, 666 prop_value = eina_hash_find(pd->properties_hash, property_set_data->property);
589 property_set_data->property); 667 if (prop_value != NULL)
590 EINA_SAFETY_ON_NULL_GOTO(prop_value, on_error); 668 {
669 if (eina_value_copy(&property_set_data->value, prop_value))
670 {
671 Efl_Model_Property_Event evt = {
672 .changed_properties = pd->properties_array
673 };
674
675 eo_event_callback_call(pd->obj, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, &evt);
676 efl_model_property_changed_notify(pd->obj, property_set_data->property);
677
678 }
679 eina_value_copy(prop_value, eina_promise_owner_buffer_get(property_set_data->promise));
680 eina_promise_owner_value_set(property_set_data->promise, NULL, (Eina_Promise_Free_Cb)&eina_value_flush);
681 }
682 else
683 {
684 eina_promise_owner_error_set(property_set_data->promise, EFL_MODEL_ERROR_NOT_FOUND);
685 }
591 686
592 ret = eina_value_copy(&property_set_data->value, prop_value); 687 _eldbus_model_proxy_property_set_data_free(property_set_data);
593 EINA_SAFETY_ON_FALSE_GOTO(ret, on_error); 688}
594 689
595 on_error: 690static bool
596 { 691_eldbus_model_proxy_has_property(Eldbus_Model_Proxy_Data *pd, const char *property)
597 Efl_Model_Property_Event evt = { 692{
598 .changed_properties = pd->properties_array 693 Eldbus_Introspection_Property *property_introspection =
599 }; 694 eldbus_introspection_property_find(pd->interface->properties, property);
600 eo_event_callback_call(pd->obj, EFL_MODEL_BASE_EVENT_PROPERTIES_CHANGED, &evt);
601 695
602 efl_model_property_changed_notify(pd->obj, property_set_data->property); 696 if (property_introspection == NULL)
603 } 697 {
698 return false;
699 }
604 700
605 _eldbus_model_proxy_property_set_data_free(property_set_data); 701 return true;
606} 702}
607 703
608static bool 704static bool
@@ -650,18 +746,19 @@ _eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *pd, const char *p
650 } 746 }
651 747
652 return property_introspection->type; 748 return property_introspection->type;
653
654} 749}
655 750
656static Eldbus_Model_Proxy_Property_Set_Data * 751static Eldbus_Model_Proxy_Property_Set_Data *
657_eldbus_model_proxy_property_set_data_new(Eldbus_Model_Proxy_Data *pd, 752_eldbus_model_proxy_property_set_data_new(Eldbus_Model_Proxy_Data *pd,
658 const char *property, 753 const char *property,
659 const Eina_Value *value) 754 const Eina_Value *value,
755 Eina_Promise_Owner *promise)
660{ 756{
661 Eldbus_Model_Proxy_Property_Set_Data *data = calloc(1, sizeof(Eldbus_Model_Proxy_Property_Set_Data)); 757 Eldbus_Model_Proxy_Property_Set_Data *data = calloc(1, sizeof(Eldbus_Model_Proxy_Property_Set_Data));
662 EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL); 758 EINA_SAFETY_ON_NULL_RETURN_VAL(data, NULL);
663 759
664 data->pd = pd; 760 data->pd = pd;
761 data->promise = promise;
665 data->property = eina_stringshare_add(property); 762 data->property = eina_stringshare_add(property);
666 if (!eina_value_copy(value, &data->value)) 763 if (!eina_value_copy(value, &data->value))
667 goto error; 764 goto error;
diff --git a/src/lib/eldbus/eldbus_model_proxy_private.h b/src/lib/eldbus/eldbus_model_proxy_private.h
index 8308a099ba..293a1f5bac 100644
--- a/src/lib/eldbus/eldbus_model_proxy_private.h
+++ b/src/lib/eldbus/eldbus_model_proxy_private.h
@@ -23,7 +23,6 @@ struct _Eldbus_Model_Proxy_Data
23 Eina_Stringshare *name; 23 Eina_Stringshare *name;
24 Eina_List *pending_list; 24 Eina_List *pending_list;
25 Eina_List *promise_list; 25 Eina_List *promise_list;
26 Eina_List *promises_set;
27 bool monitoring; 26 bool monitoring;
28 const Eldbus_Introspection_Interface *interface; 27 const Eldbus_Introspection_Interface *interface;
29 Eina_Value tmp_value; 28 Eina_Value tmp_value;
diff --git a/src/tests/eldbus/eldbus_test_eldbus_model.c b/src/tests/eldbus/eldbus_test_eldbus_model.c
index 639312bf5a..1f4ef6ae93 100644
--- a/src/tests/eldbus/eldbus_test_eldbus_model.c
+++ b/src/tests/eldbus/eldbus_test_eldbus_model.c
@@ -39,9 +39,11 @@ _promise_check_err(void *data EINA_UNUSED, void *value EINA_UNUSED)
39static void 39static void
40_error_then_ok(void* data, Eina_Error const* error) 40_error_then_ok(void* data, Eina_Error const* error)
41{ 41{
42// fprintf(stderr, "Promise ERROR CB: %s\n", eina_error_msg_get(*error)); 42 Eina_Error const* expected_error = (Eina_Error*)data;
43 if (data != NULL) 43 if (data != NULL)
44 ck_assert_ptr_ne(error, (Eina_Error*)data); 44 {
45 ck_assert_int_eq(*error, *expected_error);
46 }
45 47
46 ecore_main_loop_quit(); 48 ecore_main_loop_quit();
47} 49}