summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-11-29 11:19:31 -0200
committerMarcel Holtmann <marcel@holtmann.org>2012-11-29 17:39:50 +0100
commit912ee62e8053a4cf797351d64f27cab8ead2b820 (patch)
tree858352f38f709afcc66997791e942b62e3ecb3d5 /gdbus
parent9d043a0a4c742f5a369d37062c5b70013656a8f4 (diff)
downloadconnman-912ee62e8053a4cf797351d64f27cab8ead2b820.tar.gz
connman-912ee62e8053a4cf797351d64f27cab8ead2b820.tar.bz2
connman-912ee62e8053a4cf797351d64f27cab8ead2b820.zip
gdbus: Don't register DBus.Properties with no properties
Delay registering DBus.Properties interface until the moment there are properties on that path. This is needed for objects that currently don't expose any property to not export the interface.
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/object.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdbus/object.c b/gdbus/object.c
index 3101ca6b..47116bd5 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -1213,9 +1213,6 @@ static struct generic_data *object_path_ref(DBusConnection *connection,
manager_methods, manager_signals,
NULL, data, NULL);
- add_interface(data, DBUS_INTERFACE_PROPERTIES, properties_methods,
- properties_signals, NULL, data, NULL);
-
return data;
}
@@ -1336,6 +1333,12 @@ gboolean g_dbus_register_interface(DBusConnection *connection,
return FALSE;
}
+ if (properties != NULL && !find_interface(data->interfaces,
+ DBUS_INTERFACE_PROPERTIES))
+ add_interface(data, DBUS_INTERFACE_PROPERTIES,
+ properties_methods, properties_signals, NULL,
+ data, NULL);
+
add_interface(data, name, methods, signals, properties, user_data,
destroy);