don't generate public setter for construct-only properties, fixes bug
authorJuerg Billeter <j@bitron.ch>
Fri, 18 Jan 2008 19:12:30 +0000 (19:12 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 18 Jan 2008 19:12:30 +0000 (19:12 +0000)
2008-01-18  Juerg Billeter  <j@bitron.ch>

* gobject/valaccodegenerator.vala: don't generate public setter for
  construct-only properties, fixes bug 479062

svn path=/trunk/; revision=854

ChangeLog
gobject/valaccodegenerator.vala

index ab97e3a..c2abda2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-01-18  Jürg Billeter  <j@bitron.ch>
 
+       * gobject/valaccodegenerator.vala: don't generate public setter for
+         construct-only properties, fixes bug 479062
+
+2008-01-18  Jürg Billeter  <j@bitron.ch>
+
        * vala/scanner.l, vala/parser.y: support pointers as generic type
          arguments
 
index 453e0e2..bea94ad 100644 (file)
@@ -573,7 +573,8 @@ public class Vala.CCodeGenerator : CodeGenerator {
                                function.add_parameter (cvalueparam);
                        }
                        
-                       if (!prop.is_internal_symbol ()) {
+                       if (!prop.is_internal_symbol () && (acc.readable || acc.writable)) {
+                               // accessor function should be public if the property is a public symbol and it's not a construct-only setter
                                header_type_member_declaration.append (function.copy ());
                        } else {
                                function.modifiers |= CCodeModifiers.STATIC;
@@ -656,7 +657,8 @@ public class Vala.CCodeGenerator : CodeGenerator {
                        }
 
                        if (!is_virtual) {
-                               if (!prop.is_internal_symbol ()) {
+                               if (!prop.is_internal_symbol () && (acc.readable || acc.writable)) {
+                                       // accessor function should be public if the property is a public symbol and it's not a construct-only setter
                                        header_type_member_declaration.append (function.copy ());
                                } else {
                                        function.modifiers |= CCodeModifiers.STATIC;