mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Bug 624484: GDBusSubtreeDispatchFunc clarification
Pass NULL rather than "/" for the toplevel of a subtree. Add clarification to the docs about how trees are flat.
This commit is contained in:
parent
ca14ab7ac0
commit
8a2d157d49
@ -5199,7 +5199,7 @@ handle_subtree_introspect (GDBusConnection *connection,
|
||||
}
|
||||
else
|
||||
{
|
||||
requested_node = "/";
|
||||
requested_node = NULL;
|
||||
}
|
||||
|
||||
interfaces = es->vtable->introspect (es->connection,
|
||||
@ -5319,7 +5319,7 @@ handle_subtree_method_invocation (GDBusConnection *connection,
|
||||
}
|
||||
else
|
||||
{
|
||||
requested_node = "/";
|
||||
requested_node = NULL;
|
||||
}
|
||||
|
||||
/* get introspection data for the node */
|
||||
|
@ -330,11 +330,14 @@ typedef gchar** (*GDBusSubtreeEnumerateFunc) (GDBusConnection *connection,
|
||||
* @connection: A #GDBusConnection.
|
||||
* @sender: The unique bus name of the remote caller.
|
||||
* @object_path: The object path that was registered with g_dbus_connection_register_subtree().
|
||||
* @node: A node that is a child of @object_path (relative to @object_path) or <quote>/</quote> for the root of the subtree.
|
||||
* @node: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
|
||||
* @user_data: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
|
||||
*
|
||||
* The type of the @introspect function in #GDBusSubtreeVTable.
|
||||
*
|
||||
* Subtrees are flat. @node, if non-%NULL, is always exactly one
|
||||
* segment of the object path (ie: it never contains a slash).
|
||||
*
|
||||
* This function should return %NULL to indicate that there is no object
|
||||
* at this node.
|
||||
*
|
||||
@ -365,12 +368,15 @@ typedef GDBusInterfaceInfo ** (*GDBusSubtreeIntrospectFunc) (GDBusConnection
|
||||
* @sender: The unique bus name of the remote caller.
|
||||
* @object_path: The object path that was registered with g_dbus_connection_register_subtree().
|
||||
* @interface_name: The D-Bus interface name that the method call or property access is for.
|
||||
* @node: A node that is a child of @object_path (relative to @object_path) or <quote>/</quote> for the root of the subtree.
|
||||
* @node: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
|
||||
* @out_user_data: Return location for user data to pass to functions in the returned #GDBusInterfaceVTable (never %NULL).
|
||||
* @user_data: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
|
||||
*
|
||||
* The type of the @dispatch function in #GDBusSubtreeVTable.
|
||||
*
|
||||
* Subtrees are flat. @node, if non-%NULL, is always exactly one
|
||||
* segment of the object path (ie: it never contains a slash).
|
||||
*
|
||||
* Returns: A #GDBusInterfaceVTable or %NULL if you don't want to handle the methods.
|
||||
*
|
||||
* Since: 2.26
|
||||
|
@ -628,7 +628,11 @@ subtree_introspect (GDBusConnection *connection,
|
||||
/* VPs implement the Foo interface, EVPs implement the Bar interface. The root
|
||||
* does not implement any interfaces
|
||||
*/
|
||||
if (g_str_has_prefix (node, "vp"))
|
||||
if (node == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
else if (g_str_has_prefix (node, "vp"))
|
||||
{
|
||||
interfaces[0] = &foo_interface_info;
|
||||
}
|
||||
@ -636,10 +640,6 @@ subtree_introspect (GDBusConnection *connection,
|
||||
{
|
||||
interfaces[0] = &bar_interface_info;
|
||||
}
|
||||
else if (g_strcmp0 (node, "/") == 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
|
Loading…
Reference in New Issue
Block a user