summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-05-18 20:30:11 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2012-05-18 22:02:37 (GMT)
commit47abcc6468d02011ddc9713eb5599eb51436139e (patch)
tree472a11e8122a0651278abcd6e39e571ac5bcc682 /gdbus
parent5064f6bb6452d89cec60ba9828db5d427113ca56 (diff)
downloadconnman-47abcc6468d02011ddc9713eb5599eb51436139e.zip
connman-47abcc6468d02011ddc9713eb5599eb51436139e.tar.gz
connman-47abcc6468d02011ddc9713eb5599eb51436139e.tar.bz2
gdbus: add Deprecated annotation in introspection
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/object.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gdbus/object.c b/gdbus/object.c
index fcdd6ec..95947f3 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -82,7 +82,11 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
const GDBusSignalTable *signal;
for (method = iface->methods; method && method->name; method++) {
- if (!(method->in_args && method->in_args->name) &&
+ gboolean deprecated = method->flags &
+ G_DBUS_METHOD_FLAG_DEPRECATED;
+
+ if (!deprecated &&
+ !(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",
method->name);
@@ -91,18 +95,29 @@ static void generate_interface_xml(GString *gstr, struct interface_data *iface)
method->name);
print_arguments(gstr, method->in_args, "in");
print_arguments(gstr, method->out_args, "out");
+
+ if (deprecated)
+ g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
+
g_string_append_printf(gstr, "\t\t</method>\n");
}
}
for (signal = iface->signals; signal && signal->name; signal++) {
- if (!(signal->args && signal->args->name))
+ gboolean deprecated = signal->flags &
+ G_DBUS_SIGNAL_FLAG_DEPRECATED;
+
+ if (!deprecated && !(signal->args && signal->args->name))
g_string_append_printf(gstr, "\t\t<signal name=\"%s\"/>\n",
signal->name);
else {
g_string_append_printf(gstr, "\t\t<signal name=\"%s\">\n",
signal->name);
print_arguments(gstr, signal->args, NULL);
+
+ if (deprecated)
+ g_string_append_printf(gstr, "\t\t\t<annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n");
+
g_string_append_printf(gstr, "\t\t</signal>\n");
}
}