e_dbus: Attach interface DBus.Properties on demand
authorlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 13 Jul 2012 23:18:57 +0000 (23:18 +0000)
committerlucas <lucas@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 13 Jul 2012 23:18:57 +0000 (23:18 +0000)
If user sets the get/set callbacks, attach the DBus.Properties interface
to the path.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@73837 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/lib/dbus/e_dbus_object.c

index b09e936..84168c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -70,3 +70,4 @@
 
         * Fix properties handling
         * Check if interface already exists before attaching
+        * Fix missing DBus.Properties attach
index 7073e95..b8623b3 100644 (file)
@@ -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;
 }