]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support construct properties
authorJürg Billeter <j@bitron.ch>
Fri, 28 Nov 2008 19:55:20 +0000 (19:55 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 28 Nov 2008 19:55:20 +0000 (19:55 +0000)
2008-11-28  Jürg Billeter  <j@bitron.ch>

* vapigen/valagirparser.vala:

Support construct properties

svn path=/trunk/; revision=2079

ChangeLog
vapigen/valagirparser.vala

index 7b3848cce28af436d76f1265281f359c3a04e633..c1ddc1535ba7947f05d3ba5033c65a89ddca0965 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-28  Jürg Billeter  <j@bitron.ch>
+
+       * vapigen/valagirparser.vala:
+
+       Support construct properties
+
 2008-11-28  Jürg Billeter  <j@bitron.ch>
 
        * vapigen/valagirparser.vala:
index b15a983804dfd0af0545ffedfa13c24e79ca3633..7d267de88235c73d4e98c82f2ddf2a4fb144c9a0 100644 (file)
@@ -652,12 +652,19 @@ public class Vala.GirParser : CodeVisitor {
        Property parse_property () {
                start_element ("property");
                string name = string.joinv ("_", reader.get_attribute ("name").split ("-"));
+               string readable = reader.get_attribute ("readable");
+               string writable = reader.get_attribute ("writable");
+               string construct_ = reader.get_attribute ("construct");
                next ();
                var type = parse_type ();
                var prop = new Property (name, type, null, null, get_current_src ());
                prop.access = SymbolAccessibility.PUBLIC;
-               prop.get_accessor = new PropertyAccessor (true, false, false, null, null);
-               prop.set_accessor = new PropertyAccessor (false, true, false, null, null);
+               if (readable != "0") {
+                       prop.get_accessor = new PropertyAccessor (true, false, false, null, null);
+               }
+               if (writable == "1" || construct_ == "1") {
+                       prop.set_accessor = new PropertyAccessor (false, (writable == "1"), (construct_ == "1"), null, null);
+               }
                end_element ("property");
                return prop;
        }