diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-06-26 01:44:03 +0200 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2009-10-07 16:07:48 +0200 |
commit | cf5698f3e7f86a098dd62609bae67f2e1533c31e (patch) | |
tree | af0c62c662163d4bf33549e9f033a89ebbc69fa7 /src/gdbus/object.c | |
parent | 47809b8836f7e9ae761b89848c23824ea55a5c47 (diff) |
Use automatic object registration only
libgdbus commit ID:
b0b19a4da72972887580597aadb0b4c86e64134a
Diffstat (limited to 'src/gdbus/object.c')
-rw-r--r-- | src/gdbus/object.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gdbus/object.c b/src/gdbus/object.c index 8f0a3c0c..baf5bbe2 100644 --- a/src/gdbus/object.c +++ b/src/gdbus/object.c @@ -661,7 +661,8 @@ static DBusObjectPathVTable object_table = { * * Registers a path in the object hierarchy. */ -gboolean g_dbus_register_object(DBusConnection *connection, const char *path) +static gboolean g_dbus_register_object(DBusConnection *connection, + const char *path) { ConnectionData *data; ObjectData *object; @@ -728,7 +729,8 @@ gboolean g_dbus_register_object(DBusConnection *connection, const char *path) * Unregister the given path in the object hierarchy and * free the assigned data structures. */ -gboolean g_dbus_unregister_object(DBusConnection *connection, const char *path) +static gboolean g_dbus_unregister_object(DBusConnection *connection, + const char *path) { ConnectionData *data; ObjectData *object; @@ -769,6 +771,7 @@ gboolean g_dbus_unregister_object(DBusConnection *connection, const char *path) return TRUE; } +#if 0 /** * Unregister object hierarchy * @param connection the connection @@ -778,7 +781,7 @@ gboolean g_dbus_unregister_object(DBusConnection *connection, const char *path) * Unregister the given path and all subpaths in the * object hierarchy and free all assigned data strcutures. */ -gboolean g_dbus_unregister_object_hierarchy(DBusConnection *connection, +static gboolean g_dbus_unregister_object_hierarchy(DBusConnection *connection, const char *path) { ConnectionData *data; @@ -842,7 +845,7 @@ gboolean g_dbus_unregister_object_hierarchy(DBusConnection *connection, * * Unregister the all paths in the object hierarchy. */ -void g_dbus_unregister_all_objects(DBusConnection *connection) +static void g_dbus_unregister_all_objects(DBusConnection *connection) { ConnectionData *data; GSList *list; @@ -879,6 +882,7 @@ void g_dbus_unregister_all_objects(DBusConnection *connection) g_free(data); } +#endif /** * Register interface @@ -909,6 +913,9 @@ gboolean g_dbus_register_interface(DBusConnection *connection, DBG("connection %p path %s name %s", connection, path, name); + if (g_dbus_register_object(connection, path) == FALSE) + return FALSE; + if (dbus_connection_get_object_path_data(connection, path, (void *) &object) == FALSE) return FALSE; @@ -973,6 +980,8 @@ gboolean g_dbus_unregister_interface(DBusConnection *connection, g_free(object->introspect); object->introspect = generate_introspect(connection, path, object); + g_dbus_unregister_object(connection, path); + return TRUE; } |