[vala/staging: 10/12] vala: Replace more public fields



commit ae45d93cc019c541cf72f207d696218ed909a458
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Dec 14 19:05:55 2017 +0100

    vala: Replace more public fields

 vala/valaattribute.vala   |    3 ++-
 vala/valacodecontext.vala |   10 +++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/vala/valaattribute.vala b/vala/valaattribute.vala
index f1ef73f..ed80d66 100644
--- a/vala/valaattribute.vala
+++ b/vala/valaattribute.vala
@@ -34,7 +34,7 @@ public class Vala.Attribute : CodeNode {
        /**
         * Contains all specified attribute arguments.
         */
-       public Vala.Map<string,string> args = new HashMap<string,string> (str_hash, str_equal);
+       public Vala.Map<string,string> args { get; private set; }
 
        /**
         * Creates a new attribute.
@@ -46,6 +46,7 @@ public class Vala.Attribute : CodeNode {
        public Attribute (string name, SourceReference? source_reference = null) {
                this.name = name;
                this.source_reference = source_reference;
+               this.args = new HashMap<string,string> (str_hash, str_equal);
 
                if (!CodeContext.get ().deprecated) {
                        if (name == "Deprecated") {
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index ba369a1..404d9d8 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -116,17 +116,17 @@ public class Vala.CodeContext {
        /**
         * List of directories where to find .vapi files.
         */
-       public string[] vapi_directories = {};
+       public string[] vapi_directories { get; set; default = {}; }
 
        /**
         * List of directories where to find .gir files.
         */
-       public string[] gir_directories = {};
+       public string[] gir_directories { get; set; default = {}; }
 
        /**
         * List of directories where to find .metadata files for .gir files.
         */
-       public string[] metadata_directories = {};
+       public string[] metadata_directories { get; set; default = {}; }
 
        /**
         * Produce debug information.
@@ -198,9 +198,9 @@ public class Vala.CodeContext {
 
        public bool run_output { get; set; }
 
-       public string[] gresources = {};
+       public string[] gresources { get; set; default = {}; }
 
-       public string[] gresources_directories = {};
+       public string[] gresources_directories { get; set; default = {}; }
 
        private List<SourceFile> source_files = new ArrayList<SourceFile> ();
        private List<string> c_source_files = new ArrayList<string> ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]