]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GIR parser: Fix construct-only attribute parsing for properties e8f2dbe325cd698a9fc99041a930eec8312e5b45
authorDidier 'Ptitjes <ptitjes@free.fr>
Tue, 28 Apr 2009 22:39:23 +0000 (00:39 +0200)
committerJürg Billeter <j@bitron.ch>
Thu, 7 May 2009 16:31:21 +0000 (18:31 +0200)
Signed-off-by: Didier 'Ptitjes <ptitjes@free.fr>
vapigen/valagirparser.vala

index 62a9142d729ebff804a083d7493601248b002f8a..0912ab1be2b459372e9345e43304bd4e4168d8f4 100644 (file)
@@ -695,6 +695,7 @@ public class Vala.GirParser : CodeVisitor {
                string readable = reader.get_attribute ("readable");
                string writable = reader.get_attribute ("writable");
                string construct_ = reader.get_attribute ("construct");
+               string construct_only = reader.get_attribute ("construct-only");
                next ();
                var type = parse_type ();
                var prop = new Property (name, type, null, null, get_current_src ());
@@ -702,8 +703,8 @@ public class Vala.GirParser : CodeVisitor {
                if (readable != "0") {
                        prop.get_accessor = new PropertyAccessor (true, false, false, prop.property_type.copy (), null, null);
                }
-               if (writable == "1" || construct_ == "1") {
-                       prop.set_accessor = new PropertyAccessor (false, (writable == "1"), (construct_ == "1"), prop.property_type.copy (), null, null);
+               if (writable == "1" || construct_only == "1") {
+                       prop.set_accessor = new PropertyAccessor (false, (construct_only != "1") && (writable == "1"), (construct_only == "1") || (construct_ == "1"), prop.property_type.copy (), null, null);
                }
                end_element ("property");
                return prop;