]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: Drop PropertyAccessorType
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 16 Nov 2018 08:05:59 +0000 (09:05 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 25 Nov 2018 10:23:21 +0000 (11:23 +0100)
libvaladoc/Makefile.am
libvaladoc/api/propertyaccessor.vala
libvaladoc/api/propertyaccessortype.vala [deleted file]
valadoc/treebuilder.vala

index ef0fb552d20e8276e63020fa4e478e2f6d4b8c32..619e63e49bab1d64630a9c794a2605988f41666f 100644 (file)
@@ -79,7 +79,6 @@ libvaladoc_la_VALASOURCES = \
        api/pointer.vala \
        api/property.vala \
        api/propertyaccessor.vala \
-       api/propertyaccessortype.vala \
        api/signal.vala \
        api/signaturebuilder.vala \
        api/sourcefile.vala \
index 55bead0d9dea842f34c33e4beddb2706a70bda79..29ad225a9d16c4fa450b152e5b453011189c3524 100644 (file)
@@ -27,18 +27,16 @@ using Valadoc.Content;
  * Represents a get or set accessor of a property.
  */
 public class Valadoc.Api.PropertyAccessor : Symbol {
-       private PropertyAccessorType type;
        private Ownership ownership;
        private string? cname;
 
        public PropertyAccessor (Property parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility,
-                                                        string? cname, PropertyAccessorType type, Ownership ownership, Vala.PropertyAccessor data)
+                                                        string? cname, Ownership ownership, Vala.PropertyAccessor data)
        {
                base (parent, file, name, accessibility, null, data);
 
                this.ownership = ownership;
                this.cname = cname;
-               this.type = type;
        }
 
        /**
@@ -66,7 +64,7 @@ public class Valadoc.Api.PropertyAccessor : Symbol {
         */
        public bool is_construct {
                get {
-                       return (type & PropertyAccessorType.CONSTRUCT) != 0;
+                       return ((Vala.PropertyAccessor) data).construction;
                }
        }
 
@@ -75,7 +73,7 @@ public class Valadoc.Api.PropertyAccessor : Symbol {
         */
        public bool is_set {
                get {
-                       return (type & PropertyAccessorType.SET) != 0;
+                       return ((Vala.PropertyAccessor) data).writable;
                }
        }
 
@@ -84,7 +82,7 @@ public class Valadoc.Api.PropertyAccessor : Symbol {
         */
        public bool is_get {
                get {
-                       return (type & PropertyAccessorType.GET) != 0;
+                       return ((Vala.PropertyAccessor) data).readable;
                }
        }
 
diff --git a/libvaladoc/api/propertyaccessortype.vala b/libvaladoc/api/propertyaccessortype.vala
deleted file mode 100644 (file)
index 0856682..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* propertyaccessor.vala
- *
- * Copyright (C) 2011  Florian Brosch
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- *
- * Author:
- *     Florian Brosch <flo.brosch@gmail.com>
- */
-
-
-public enum Valadoc.Api.PropertyAccessorType {
-       CONSTRUCT = 1 << 0,
-       SET = 1 << 1,
-       GET = 1 << 2;
-
-       public unowned string to_string () {
-               if ((this & PropertyAccessorType.CONSTRUCT) != 0) {
-                       if ((this & PropertyAccessorType.SET) != 0) {
-                               return "construct set";
-                       }
-                       return "construct";
-               } else if ((this & PropertyAccessorType.SET) != 0) {
-                       return "set";
-               } else if ((this & PropertyAccessorType.GET) != 0) {
-                       return "get";
-               }
-
-               assert_not_reached ();
-       }
-}
index 79a17ee57af283d56785ffd86d22a8ad5f04527a..7c5d4d112d9dd287727f16d398b901fde5e20532 100644 (file)
@@ -496,21 +496,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
                return meta_data.get_namespace ((Vala.Namespace) namespace_symbol, file);
        }
 
-       private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
-               if (element.construction) {
-                       if (element.writable) {
-                               return (PropertyAccessorType.CONSTRUCT | PropertyAccessorType.SET);
-                       }
-                       return PropertyAccessorType.CONSTRUCT;
-               } else if (element.writable) {
-                       return PropertyAccessorType.SET;
-               } else if (element.readable) {
-                       return PropertyAccessorType.GET;
-               }
-
-               error ("Unknown symbol accessibility type");
-       }
-
        private bool type_reference_pass_ownership (Vala.DataType? element) {
                if (element == null) {
                        return false;
@@ -1050,7 +1035,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
                                                                                                element.name,
                                                                                                accessor.access,
                                                                                                get_cname (accessor),
-                                                                                               get_property_accessor_type (accessor),
                                                                                                get_property_ownership (accessor),
                                                                                                accessor);
                }
@@ -1062,7 +1046,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
                                                                                                element.name,
                                                                                                accessor.access,
                                                                                                get_cname (accessor),
-                                                                                               get_property_accessor_type (accessor),
                                                                                                get_property_ownership (accessor),
                                                                                                accessor);
                }