From: Rico Tzschichholz Date: Sat, 27 Apr 2019 18:21:44 +0000 (+0200) Subject: girwriter: Don't write "property" attribute for non-gobject properties X-Git-Tag: 0.45.1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fa987e9501e222e0fc44839f1d492f450b2e7af;p=thirdparty%2Fvala.git girwriter: Don't write "property" attribute for non-gobject properties --- diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala index 7a0191b72..c125f5467 100644 --- a/codegen/valagirwriter.vala +++ b/codegen/valagirwriter.vala @@ -1147,32 +1147,34 @@ public class Vala.GIRWriter : CodeVisitor { return; } - write_indent (); - 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 ("\n"); + indent--; + write_indent (); + buffer.append_printf ("\n"); + } if (prop.get_accessor != null) { var m = prop.get_accessor.get_method (); diff --git a/tests/girwriter/GirTest-1.0.gir-expected b/tests/girwriter/GirTest-1.0.gir-expected index 1bad12723..7825333d1 100644 --- a/tests/girwriter/GirTest-1.0.gir-expected +++ b/tests/girwriter/GirTest-1.0.gir-expected @@ -40,6 +40,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/girwriter/girtest.vala b/tests/girwriter/girtest.vala index eb762443f..9d23113b0 100644 --- a/tests/girwriter/girtest.vala +++ b/tests/girwriter/girtest.vala @@ -81,6 +81,10 @@ namespace GirTest { [GIR (visible = false)] public delegate void SkippedDelegate (); + public class TypeTest { + public string some_property { get; set; } + } + public class ObjectTest : Object { private static ObjectTest global_instance = new ObjectTest (); diff --git a/tests/girwriter/girtest.vapi-expected b/tests/girwriter/girtest.vapi-expected index 3dc664ab6..809e12cca 100644 --- a/tests/girwriter/girtest.vapi-expected +++ b/tests/girwriter/girtest.vapi-expected @@ -81,6 +81,11 @@ namespace GirTest { public SkippedStruct (); } [CCode (cheader_filename = "girtest.h")] + public class TypeTest { + public TypeTest (); + public string some_property { get; set; } + } + [CCode (cheader_filename = "girtest.h")] public interface InterfaceTest : GLib.Object { public virtual async void coroutine_async (); public virtual void int8_in (int8 param);