gdbus: add Method.NoReply annotation in introspection
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Fri, 18 May 2012 20:30:12 +0000 (17:30 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 18 May 2012 22:02:37 +0000 (15:02 -0700)
gdbus/object.c

index 95947f368d2b492b09c9848ed48aabe21f101aa6..dacbe58758c628396ab49b32c6da2a9abed4257d 100644 (file)
@@ -84,8 +84,10 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
        for (method = iface->methods; method && method->name; method++) {
                gboolean deprecated = method->flags &
                                                G_DBUS_METHOD_FLAG_DEPRECATED;
+               gboolean noreply = method->flags &
+                                               G_DBUS_METHOD_FLAG_NOREPLY;
 
-               if (!deprecated &&
+               if (!deprecated && !noreply &&
                                !(method->in_args && method->in_args->name) &&
                                !(method->out_args && method->out_args->name))
                        g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
@@ -99,6 +101,9 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
                        if (deprecated)
                                g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
 
+                       if (noreply)
+                               g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>\n");
+
                        g_string_append_printf(gstr, "\t\t</method>\n");
                }
        }