Commit 9b3ace43 authored by Rico Tzschichholz's avatar Rico Tzschichholz

libvaladoc: Clean up Api.Property/PropertyAccessor constructor

parent 8f188107
......@@ -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);
}
/**
......
......@@ -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;
}
/**
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment