summaryrefslogtreecommitdiff
path: root/legacy/edbus/src/lib/edbus_proxy.c
diff options
context:
space:
mode:
authorJosé Roberto de Souza <zehortigoza@profusion.mobi>2012-12-11 19:52:06 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2012-12-11 19:52:06 +0000
commitd3a279ff565f2618620f8f8c1f0500280fab02d5 (patch)
tree9fecbffe9db53de6bb530bcb1937d82912f80e88 /legacy/edbus/src/lib/edbus_proxy.c
parentcbc0a8311a5847ee4d97a317854eafa53f4afab3 (diff)
edbus: Only one ref of Properties interface in each object
Patch by: José Roberto de Souza <zehortigoza@profusion.mobi> SVN revision: 80708
Diffstat (limited to '')
-rw-r--r--legacy/edbus/src/lib/edbus_proxy.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/legacy/edbus/src/lib/edbus_proxy.c b/legacy/edbus/src/lib/edbus_proxy.c
index a2092da960..377e3f69ee 100644
--- a/legacy/edbus/src/lib/edbus_proxy.c
+++ b/legacy/edbus/src/lib/edbus_proxy.c
@@ -88,7 +88,6 @@ edbus_proxy_shutdown(void)
88static void _edbus_proxy_event_callback_call(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type, const void *event_info); 88static void _edbus_proxy_event_callback_call(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type, const void *event_info);
89static void _edbus_proxy_context_event_cb_del(EDBus_Proxy_Context_Event *ce, EDBus_Proxy_Context_Event_Cb *ctx); 89static void _edbus_proxy_context_event_cb_del(EDBus_Proxy_Context_Event *ce, EDBus_Proxy_Context_Event_Cb *ctx);
90static void _on_signal_handler_free(void *data, const void *dead_pointer); 90static void _on_signal_handler_free(void *data, const void *dead_pointer);
91static EDBus_Proxy *get_properties_proxy(EDBus_Proxy *proxy);
92 91
93static void 92static void
94_edbus_proxy_call_del(EDBus_Proxy *proxy) 93_edbus_proxy_call_del(EDBus_Proxy *proxy)
@@ -615,18 +614,12 @@ edbus_proxy_signal_handler_add(EDBus_Proxy *proxy, const char *member, EDBus_Sig
615 return handler; 614 return handler;
616} 615}
617 616
618static EDBus_Proxy *
619get_properties_proxy(EDBus_Proxy *proxy)
620{
621 return edbus_proxy_get(proxy->obj, EDBUS_FDO_INTERFACE_PROPERTIES);
622}
623
624EAPI EDBus_Pending * 617EAPI EDBus_Pending *
625edbus_proxy_property_get(EDBus_Proxy *proxy, const char *name, EDBus_Message_Cb cb, const void *data) 618edbus_proxy_property_get(EDBus_Proxy *proxy, const char *name, EDBus_Message_Cb cb, const void *data)
626{ 619{
627 EDBUS_PROXY_CHECK_RETVAL(proxy, NULL); 620 EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
628 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); 621 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
629 return edbus_proxy_call(get_properties_proxy(proxy), "Get", cb, data, -1, 622 return edbus_proxy_call(proxy->obj->properties, "Get", cb, data, -1,
630 "ss", proxy->interface, name); 623 "ss", proxy->interface, name);
631} 624}
632 625
@@ -648,7 +641,7 @@ edbus_proxy_property_set(EDBus_Proxy *proxy, const char *name, char type, const
648 641
649 sig[0] = type; 642 sig[0] = type;
650 sig[1] = 0; 643 sig[1] = 0;
651 msg = edbus_proxy_method_call_new(get_properties_proxy(proxy), "Set"); 644 msg = edbus_proxy_method_call_new(proxy->obj->properties, "Set");
652 iter = edbus_message_iter_get(msg); 645 iter = edbus_message_iter_get(msg);
653 edbus_message_iter_basic_append(iter, 's', proxy->interface); 646 edbus_message_iter_basic_append(iter, 's', proxy->interface);
654 edbus_message_iter_basic_append(iter, 's', name); 647 edbus_message_iter_basic_append(iter, 's', name);
@@ -656,7 +649,7 @@ edbus_proxy_property_set(EDBus_Proxy *proxy, const char *name, char type, const
656 edbus_message_iter_basic_append(variant, type, value); 649 edbus_message_iter_basic_append(variant, type, value);
657 edbus_message_iter_container_close(iter, variant); 650 edbus_message_iter_container_close(iter, variant);
658 651
659 pending = edbus_proxy_send(get_properties_proxy(proxy), msg, cb, data, -1); 652 pending = edbus_proxy_send(proxy->obj->properties, msg, cb, data, -1);
660 edbus_message_unref(msg); 653 edbus_message_unref(msg);
661 654
662 return pending; 655 return pending;
@@ -666,7 +659,7 @@ EAPI EDBus_Pending *
666edbus_proxy_property_get_all(EDBus_Proxy *proxy, EDBus_Message_Cb cb, const void *data) 659edbus_proxy_property_get_all(EDBus_Proxy *proxy, EDBus_Message_Cb cb, const void *data)
667{ 660{
668 EDBUS_PROXY_CHECK_RETVAL(proxy, NULL); 661 EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
669 return edbus_proxy_call(get_properties_proxy(proxy), "GetAll", cb, data, -1, 662 return edbus_proxy_call(proxy->obj->properties, "GetAll", cb, data, -1,
670 "s", proxy->interface); 663 "s", proxy->interface);
671} 664}
672 665
@@ -675,7 +668,7 @@ edbus_proxy_properties_changed_callback_add(EDBus_Proxy *proxy, EDBus_Signal_Cb
675{ 668{
676 EDBus_Signal_Handler *sh; 669 EDBus_Signal_Handler *sh;
677 EDBUS_PROXY_CHECK_RETVAL(proxy, NULL); 670 EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
678 sh = edbus_proxy_signal_handler_add(get_properties_proxy(proxy), 671 sh = edbus_proxy_signal_handler_add(proxy->obj->properties,
679 "PropertiesChanged", cb, data); 672 "PropertiesChanged", cb, data);
680 EINA_SAFETY_ON_NULL_RETURN_VAL(sh, NULL); 673 EINA_SAFETY_ON_NULL_RETURN_VAL(sh, NULL);
681 edbus_signal_handler_match_extra_set(sh, "arg0", proxy->interface, NULL); 674 edbus_signal_handler_match_extra_set(sh, "arg0", proxy->interface, NULL);