[vala/0.36] girwriter: Don't write "property" attribute for non-gobject properties



commit d6e1f49d6a267eea17e295aa45e32f72e47834eb
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Apr 27 20:21:44 2019 +0200

    girwriter: Don't write "property" attribute for non-gobject properties

 codegen/valagirwriter.vala | 44 +++++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 21 deletions(-)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 17db20645..3696d7d14 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -1145,32 +1145,34 @@ public class Vala.GIRWriter : CodeVisitor {
                        return;
                }
 
-               write_indent ();
-               buffer.append_printf ("<property name=\"%s\"", prop.name.replace ("_", "-"));
-               if (prop.get_accessor == null) {
-                       buffer.append_printf (" readable=\"0\"");
-               }
-               if (prop.set_accessor != null) {
-                       buffer.append_printf (" writable=\"1\"");
-                       if (prop.set_accessor.construction) {
-                               if (!prop.set_accessor.writable) {
-                                       buffer.append_printf (" construct-only=\"1\"");
-                               } else {
-                                       buffer.append_printf (" construct=\"1\"");
+               if (((CCodeBaseModule) context.codegen).is_gobject_property (prop)) {
+                       write_indent ();
+                       buffer.append_printf ("<property name=\"%s\"", prop.name.replace ("_", "-"));
+                       if (prop.get_accessor == null) {
+                               buffer.append_printf (" readable=\"0\"");
+                       }
+                       if (prop.set_accessor != null) {
+                               buffer.append_printf (" writable=\"1\"");
+                               if (prop.set_accessor.construction) {
+                                       if (!prop.set_accessor.writable) {
+                                               buffer.append_printf (" construct-only=\"1\"");
+                                       } else {
+                                               buffer.append_printf (" construct=\"1\"");
+                                       }
                                }
                        }
-               }
-               write_symbol_attributes (prop);
-               buffer.append_printf (">\n");
-               indent++;
+                       write_symbol_attributes (prop);
+                       buffer.append_printf (">\n");
+                       indent++;
 
-               write_doc (get_property_comment (prop));
+                       write_doc (get_property_comment (prop));
 
-               write_type (prop.property_type);
+                       write_type (prop.property_type);
 
-               indent--;
-               write_indent ();
-               buffer.append_printf ("</property>\n");
+                       indent--;
+                       write_indent ();
+                       buffer.append_printf ("</property>\n");
+               }
 
                if (prop.get_accessor != null) {
                        var m = prop.get_accessor.get_method ();


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