[vala/wip/attributes: 6/31] On-demand Class.is_immutable
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/attributes: 6/31] On-demand Class.is_immutable
- Date: Wed, 27 Jul 2011 18:30:43 +0000 (UTC)
commit 3a42d9a63bbb4488e2c4a24ca4ac409c67529eb5
Author: Luca Bruno <lucabru src gnome org>
Date: Thu Jul 7 11:46:12 2011 +0200
On-demand Class.is_immutable
vala/valaclass.vala | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/vala/valaclass.vala b/vala/valaclass.vala
index f595248..be1862a 100644
--- a/vala/valaclass.vala
+++ b/vala/valaclass.vala
@@ -66,10 +66,14 @@ public class Vala.Class : ObjectTypeSymbol {
if (base_class != null) {
return base_class.is_immutable;
}
+ if (_is_immutable == null) {
+ _is_immutable = get_attribute ("Immutable") != null;
+ }
return _is_immutable;
}
set {
_is_immutable = value;
+ set_attribute ("Immutable", value);
}
}
@@ -131,7 +135,7 @@ public class Vala.Class : ObjectTypeSymbol {
private string set_value_function;
private string take_value_function;
private bool? _is_compact;
- private bool _is_immutable;
+ private bool? _is_immutable;
private List<DataType> base_types = new ArrayList<DataType> ();
@@ -749,8 +753,6 @@ public class Vala.Class : ObjectTypeSymbol {
foreach (Attribute a in attributes) {
if (a.name == "CCode") {
process_ccode_attribute (a);
- } else if (a.name == "Immutable") {
- is_immutable = true;
} else if (a.name == "Deprecated") {
process_deprecated_attribute (a);
} else if (a.name == "GIR") {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]