[glib/wip/rishi/gdbus-codegen-deprecated: 1/2] gdbus-codegen: Tag properties so annotated with G_PARAM_DEPRECATED



commit 56a27fa0a5f30620ce471631c86b1c101d6f67df
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Nov 21 16:05:20 2018 +0100

    gdbus-codegen: Tag properties so annotated with G_PARAM_DEPRECATED
    
    If a D-Bus interface has a property that's annotated with
    org.freedesktop.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.

 gio/gdbus-2.0/codegen/codegen.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gio/gdbus-2.0/codegen/codegen.py b/gio/gdbus-2.0/codegen/codegen.py
index d393f65cb..e267f8a5e 100644
--- a/gio/gdbus-2.0/codegen/codegen.py
+++ b/gio/gdbus-2.0/codegen/codegen.py
@@ -1523,7 +1523,10 @@ class CodeGenerator:
                     s = 'g_param_spec_boxed ("%s", "%s", "%s", G_TYPE_STRV'%(p.name_hyphen, p.name, p.name)
                 else:
                     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'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]