Add introspection interface to the output of introspection calls
authorRISKÓ Gergely <gergely@risko.hu>
Mon, 14 Sep 2009 14:52:43 +0000 (17:52 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 14 Sep 2009 21:07:37 +0000 (14:07 -0700)
This provides better compatibility with some D-Bus clients, such as qdbus.

gdbus/object.c

index 3186921..811c2e1 100644 (file)
@@ -155,7 +155,13 @@ static void generate_introspection_xml(DBusConnection *conn,
 
        gstr = g_string_new(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE);
 
-       g_string_append_printf(gstr, "<node name=\"%s\">\n", path);
+       g_string_append_printf(gstr,
+               "<node name=\"%s\">\n"
+               "\t<interface name=\"org.freedesktop.DBus.Introspectable\">\n"
+               "\t\t<method name=\"Introspect\">\n"
+               "\t\t\t<arg name=\"xml_data\" type=\"s\" direction=\"out\"/>\n"
+               "\t\t</method>\n"
+               "\t</interface>\n", path);
 
        for (list = data->interfaces; list; list = list->next) {
                struct interface_data *iface = list->data;