]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girwriter: Don't write "property" attribute for non-gobject properties
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 27 Apr 2019 18:21:44 +0000 (20:21 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 6 Aug 2019 11:36:35 +0000 (13:36 +0200)
codegen/valagirwriter.vala

index 17db206451a5f452781afd3610549ea816169f2f..3696d7d14f325c5a12b8a772dbcbf7dadfc21166 100644 (file)
@@ -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 ();