diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-11-29 11:19:31 -0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2012-11-29 16:35:22 +0200 |
commit | f3887afd845e57b1d8fb6d1325fc9fc83ce86227 (patch) | |
tree | 7e66fe84b684773d701505a209ec3f919137035d | |
parent | 74bcd288e97a9bc8cadc3ae74acda1516bba6f70 (diff) | |
download | obexd-f3887afd845e57b1d8fb6d1325fc9fc83ce86227.tar.gz |
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.
-rw-r--r-- | gdbus/object.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gdbus/object.c b/gdbus/object.c index 3101ca6..47116bd 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); |