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



commit 53573d98f5dfeb77789e9b310dd29343ebeb81a4
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Nov 23 10:13:17 2018 +0100

    gdbus-codegen: Tag interfaces so annotated with G_PARAM_DEPRECATED
    
    If a D-Bus interface was annotated with o.fd.DBus.Deprecated, then the
    corresponding GObject property, in the common GInterface implemented
    by the generated GDBusObjectProxies and GDBusObjectSkeletons, to
    access the generated code for the D-Bus interface 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

 gio/gdbus-2.0/codegen/codegen.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gio/gdbus-2.0/codegen/codegen.py b/gio/gdbus-2.0/codegen/codegen.py
index e267f8a5e..9d2b904c7 100644
--- a/gio/gdbus-2.0/codegen/codegen.py
+++ b/gio/gdbus-2.0/codegen/codegen.py
@@ -3,7 +3,7 @@
 
 # GDBus - GLib D-Bus Library
 #
-# Copyright (C) 2008-2011 Red Hat, Inc.
+# Copyright (C) 2008-2018 Red Hat, Inc.
 # Copyright (C) 2018 Iñigo Martínez <inigomartinez gmail com>
 #
 # This library is free software; you can redistribute it and/or
@@ -3061,9 +3061,12 @@ class CodeGenerator:
                     '   * Connect to the #GObject::notify signal to get informed of property changes.\n'
                     %(self.namespace, i.name_hyphen, i.camel_name, i.name), False))
             self.write_gtkdoc_deprecated_and_since_and_close(i, self.outfile, 2)
-            self.outfile.write('  g_object_interface_install_property (iface, g_param_spec_object ("%s", 
"%s", "%s", %sTYPE_%s, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));\n'
+            flags = 'G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS'
+            if i.deprecated:
+                flags = 'G_PARAM_DEPRECATED | ' + flags
+            self.outfile.write('  g_object_interface_install_property (iface, g_param_spec_object ("%s", 
"%s", "%s", %sTYPE_%s, %s));\n'
                                '\n'
-                               %(i.name_hyphen, i.name_hyphen, i.name_hyphen, self.ns_upper, i.name_upper))
+                               %(i.name_hyphen, i.name_hyphen, i.name_hyphen, self.ns_upper, i.name_upper, 
flags))
         self.outfile.write('}\n'
                            '\n')
 


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