From: Rico Tzschichholz Date: Fri, 16 Nov 2018 08:05:59 +0000 (+0100) Subject: libvaladoc: Drop PropertyAccessorType X-Git-Tag: 0.43.1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af9c1c3d08943f3cb723a7a1a9d9d1f8b879722f;p=thirdparty%2Fvala.git libvaladoc: Drop PropertyAccessorType --- diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am index ef0fb552d..619e63e49 100644 --- a/libvaladoc/Makefile.am +++ b/libvaladoc/Makefile.am @@ -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 \ diff --git a/libvaladoc/api/propertyaccessor.vala b/libvaladoc/api/propertyaccessor.vala index 55bead0d9..29ad225a9 100644 --- a/libvaladoc/api/propertyaccessor.vala +++ b/libvaladoc/api/propertyaccessor.vala @@ -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 index 08566828d..000000000 --- a/libvaladoc/api/propertyaccessortype.vala +++ /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 - */ - - -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 (); - } -} diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala index 79a17ee57..7c5d4d112 100644 --- a/valadoc/treebuilder.vala +++ b/valadoc/treebuilder.vala @@ -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); }