From 623d7be9340c21c507e26344826510827c08aaa1 Mon Sep 17 00:00:00 2001 From: lucas Date: Fri, 13 Jul 2012 23:18:57 +0000 Subject: [PATCH] e_dbus: Attach interface DBus.Properties on demand MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If user sets the get/set callbacks, attach the DBus.Properties interface to the path. Patch by: José Roberto de Souza git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@73837 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 1 + src/lib/dbus/e_dbus_object.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index b09e936..84168c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -70,3 +70,4 @@ * Fix properties handling * Check if interface already exists before attaching + * Fix missing DBus.Properties attach diff --git a/src/lib/dbus/e_dbus_object.c b/src/lib/dbus/e_dbus_object.c index 7073e95..b8623b3 100644 --- a/src/lib/dbus/e_dbus_object.c +++ b/src/lib/dbus/e_dbus_object.c @@ -292,12 +292,18 @@ e_dbus_object_interfaces_get(E_DBus_Object *obj) EAPI void e_dbus_object_property_get_cb_set(E_DBus_Object *obj, E_DBus_Object_Property_Get_Cb func) { + EINA_SAFETY_ON_NULL_RETURN(obj); + if (obj->cb_property_get == NULL && obj->cb_property_set == NULL) + e_dbus_object_interface_attach(obj, properties_interface); obj->cb_property_get = func; } EAPI void e_dbus_object_property_set_cb_set(E_DBus_Object *obj, E_DBus_Object_Property_Set_Cb func) { + EINA_SAFETY_ON_NULL_RETURN(obj); + if (obj->cb_property_get == NULL && obj->cb_property_set == NULL) + e_dbus_object_interface_attach(obj, properties_interface); obj->cb_property_set = func; } -- 2.7.4