[valadoc] Add support for unowned/weak array elements
- From: Florian Brosch <flobrosch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [valadoc] Add support for unowned/weak array elements
- Date: Tue, 2 Sep 2014 17:17:51 +0000 (UTC)
commit 0e166c04eb66137bc2b8ed69388f3fc620298e4d
Author: Florian Brosch <flo brosch gmail com>
Date: Sat Aug 30 22:35:52 2014 +0200
Add support for unowned/weak array elements
src/libvaladoc/api/array.vala | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/src/libvaladoc/api/array.vala b/src/libvaladoc/api/array.vala
index ef2a1d4..cfbd642 100644
--- a/src/libvaladoc/api/array.vala
+++ b/src/libvaladoc/api/array.vala
@@ -43,13 +43,28 @@ public class Valadoc.Api.Array : Item {
this.parent = parent;
}
+ private inline bool element_is_owned () {
+ TypeReference reference = data_type as TypeReference;
+ if (reference == null) {
+ return true;
+ }
+
+ return !reference.is_unowned && !reference.is_weak;
+ }
+
/**
* { inheritDoc}
*/
protected override Inline build_signature () {
- return new SignatureBuilder ()
- .append_content (data_type.signature)
- .append ("[]", false)
- .get ();
+ SignatureBuilder builder = new SignatureBuilder ();
+ if (element_is_owned ()) {
+ builder.append_content (data_type.signature);
+ } else {
+ builder.append ("(", false);
+ builder.append_content (data_type.signature, false);
+ builder.append (")", false);
+ }
+ builder.append ("[]", false);
+ return builder.get ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]