From: Rico Tzschichholz Date: Tue, 12 Jun 2018 13:41:41 +0000 (+0200) Subject: libvaladoc: Clean up Api.Property/PropertyAccessor constructor X-Git-Tag: 0.43.1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b3ace435f5810e25e763730c5980fafa456af4c;p=thirdparty%2Fvala.git libvaladoc: Clean up Api.Property/PropertyAccessor constructor --- diff --git a/libvaladoc/api/property.vala b/libvaladoc/api/property.vala index 2a0182e4c..9c144c333 100644 --- a/libvaladoc/api/property.vala +++ b/libvaladoc/api/property.vala @@ -31,15 +31,15 @@ public class Valadoc.Api.Property : Symbol { private string? cname; public Property (Node parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility, - SourceComment? comment, string? cname, string? dbus_name, bool is_dbus_visible, + SourceComment? comment, Vala.Property data) { base (parent, file, name, accessibility, comment, data); - this.is_dbus_visible = is_dbus_visible; + this.is_dbus_visible = Vala.GDBusModule.is_dbus_visible (data); - this.dbus_name = dbus_name; - this.cname = cname; + this.dbus_name = Vala.GDBusModule.get_dbus_name_for_member (data); + this.cname = Vala.get_ccode_name (data); } /** diff --git a/libvaladoc/api/propertyaccessor.vala b/libvaladoc/api/propertyaccessor.vala index 29ad225a9..56ad06719 100644 --- a/libvaladoc/api/propertyaccessor.vala +++ b/libvaladoc/api/propertyaccessor.vala @@ -31,12 +31,21 @@ public class Valadoc.Api.PropertyAccessor : Symbol { private string? cname; public PropertyAccessor (Property parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility, - string? cname, Ownership ownership, Vala.PropertyAccessor data) + Vala.PropertyAccessor data) { base (parent, file, name, accessibility, null, data); - this.ownership = ownership; - this.cname = cname; + this.ownership = get_property_ownership (data); + this.cname = Vala.get_ccode_name (data); + } + + Ownership get_property_ownership (Vala.PropertyAccessor element) { + if (element.value_type.value_owned) { + return Ownership.OWNED; + } + + // the exact type (weak, unowned) does not matter + return Ownership.UNOWNED; } /** diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala index b0ef026e9..4f809bd97 100644 --- a/valadoc/treebuilder.vala +++ b/valadoc/treebuilder.vala @@ -488,15 +488,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor { return meta_data.get_namespace ((Vala.Namespace) namespace_symbol, file); } - private Ownership get_property_ownership (Vala.PropertyAccessor element) { - if (element.value_type.value_owned) { - return Ownership.OWNED; - } - - // the exact type (weak, unowned) does not matter - return Ownership.UNOWNED; - } - // // Vala tree creation: @@ -922,9 +913,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor { element.name, element.access, comment, - element.nick, - Vala.GDBusModule.get_dbus_name_for_member (element), - Vala.GDBusModule.is_dbus_visible (element), element); node.property_type = create_type_reference (element.property_type, node, node); symbol_map.set (element, node); @@ -937,8 +925,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor { file, element.name, accessor.access, - get_cname (accessor), - get_property_ownership (accessor), accessor); } @@ -948,8 +934,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor { file, element.name, accessor.access, - get_cname (accessor), - get_property_ownership (accessor), accessor); }