gdbus-codegen: Tag properties so annotated with G_PARAM_DEPRECATED

If a D-Bus interface has a property that's annotated with
o.fd.DBus.Deprecated, then the corresponding GObject property was not
being marked with G_PARAM_DEPRECATED, even though the gtk-doc snippet
had the 'Deprecated: ' tag.

G_PARAM_DEPRECATED is older than gdbus-codegen, 2.26 and 2.30
respectively, hence it can be used unconditionally.

https://gitlab.gnome.org/GNOME/glib/merge_requests/485
This commit is contained in:
Debarshi Ray 2018-11-21 16:05:20 +01:00
parent b660a67cb3
commit 52ce05aaa7

View File

@ -1523,7 +1523,10 @@ class CodeGenerator:
s = 'g_param_spec_boxed ("%s", "%s", "%s", G_TYPE_STRV'%(p.name_hyphen, p.name, p.name) s = 'g_param_spec_boxed ("%s", "%s", "%s", G_TYPE_STRV'%(p.name_hyphen, p.name, p.name)
else: else:
print_error('Unsupported gtype "{}" for GParamSpec'.format(p.arg.gtype)) print_error('Unsupported gtype "{}" for GParamSpec'.format(p.arg.gtype))
self.outfile.write(' %s, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));'%s); flags = 'G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS'
if p.deprecated:
flags = 'G_PARAM_DEPRECATED | ' + flags
self.outfile.write(' %s, %s));'%(s, flags));
self.outfile.write('\n') self.outfile.write('\n')
self.outfile.write('}\n' self.outfile.write('}\n'