[vala/wip/attributes: 110/119] Drop property nick and blurb
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/attributes: 110/119] Drop property nick and blurb
- Date: Mon, 4 Jul 2011 10:31:19 +0000 (UTC)
commit fb65aa86002437dd025a8cff1022e32eb8e197c1
Author: Luca Bruno <lucabru src gnome org>
Date: Sun Jul 3 19:19:35 2011 +0200
Drop property nick and blurb
codegen/valagtypemodule.vala | 12 +++++++++-
vala/valaproperty.vala | 44 ------------------------------------------
2 files changed, 10 insertions(+), 46 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 2a85c07..180134d 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1656,8 +1656,16 @@ public class Vala.GTypeModule : GErrorModule {
public override CCodeFunctionCall get_param_spec (Property prop) {
var cspec = new CCodeFunctionCall ();
cspec.add_argument (get_property_canonical_cconstant (prop));
- cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.nick)));
- cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.blurb)));
+ var nick = prop.get_attribute_string ("Description", "nick");
+ if (nick == null) {
+ nick = prop.name.replace ("_", "-");
+ }
+ var blurb = prop.get_attribute_string ("Description", "blurb");
+ if (blurb == null) {
+ blurb = prop.name.replace ("_", "-");
+ }
+ cspec.add_argument (new CCodeConstant ("\"%s\"".printf (nick)));
+ cspec.add_argument (new CCodeConstant ("\"%s\"".printf (blurb)));
if (prop.property_type.data_type is Class || prop.property_type.data_type is Interface) {
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala
index a6da453..81bf994 100644
--- a/vala/valaproperty.vala
+++ b/vala/valaproperty.vala
@@ -134,32 +134,6 @@ public class Vala.Property : Symbol, Lockable {
*/
public Expression initializer { get; set; }
- /**
- * Nickname of this property.
- */
- public string nick {
- get {
- if (_nick == null) {
- _nick = name.replace ("_", "-");
- }
- return _nick;
- }
- set { _nick = value; }
- }
-
- /**
- * The long description of this property.
- */
- public string blurb {
- get {
- if (_blurb == null) {
- _blurb = nick;
- }
- return _blurb;
- }
- set { _blurb = value; }
- }
-
private bool lock_used = false;
private DataType _data_type;
@@ -209,22 +183,6 @@ public class Vala.Property : Symbol, Lockable {
}
}
- /**
- * Process all associated attributes.
- */
- public void process_attributes () {
- foreach (Attribute a in attributes) {
- if (a.name == "Description") {
- if (a.has_argument ("nick")) {
- nick = a.get_string ("nick");
- }
- if (a.has_argument ("blurb")) {
- blurb = a.get_string ("blurb");
- }
- }
- }
- }
-
public bool get_lock_used () {
return lock_used;
}
@@ -353,8 +311,6 @@ public class Vala.Property : Symbol, Lockable {
checked = true;
- process_attributes ();
-
if (is_abstract) {
if (parent_symbol is Class) {
var cl = (Class) parent_symbol;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]