summaryrefslogtreecommitdiff
path: root/codegen
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2016-11-11 20:04:06 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2016-11-11 20:21:27 +0100
commita9677aa57de0fe0fd5eb23938f562e4ba9b0556b (patch)
treeff0e7bca89d907c3b2f6eb566bcc464e418e6a84 /codegen
parentcccf2ad9f2c6d3bb96af755bbb325bc27f232c10 (diff)
downloadvala-a9677aa57de0fe0fd5eb23938f562e4ba9b0556b.tar.gz
Move "blurb", "nick" and "notify" into Property
Diffstat (limited to 'codegen')
-rw-r--r--codegen/valaccodebasemodule.vala22
-rw-r--r--codegen/valagtypemodule.vala6
2 files changed, 3 insertions, 25 deletions
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 4641aff08..3e4da4006 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1770,7 +1770,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
// notify on property changes
if (is_gobject_property (prop) &&
- get_ccode_notify (prop) &&
+ prop.notify &&
(acc.writable || acc.construction)) {
var notify_call = new CCodeFunctionCall (new CCodeIdentifier ("g_object_notify"));
notify_call.add_argument (new CCodeCastExpression (new CCodeIdentifier ("self"), "GObject *"));
@@ -6393,26 +6393,6 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
return get_ccode_attribute(m).sentinel;
}
- public static bool get_ccode_notify (Property prop) {
- return prop.get_attribute_bool ("CCode", "notify", true);
- }
-
- public static string get_ccode_nick (Property prop) {
- var nick = prop.get_attribute_string ("Description", "nick");
- if (nick == null) {
- nick = prop.name.replace ("_", "-");
- }
- return nick;
- }
-
- public static string get_ccode_blurb (Property prop) {
- var blurb = prop.get_attribute_string ("Description", "blurb");
- if (blurb == null) {
- blurb = prop.name.replace ("_", "-");
- }
- return blurb;
- }
-
public CCodeDeclaratorSuffix? get_ccode_declarator_suffix (DataType type) {
var array_type = type as ArrayType;
if (array_type != null) {
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 1b5c2f141..af7a8a481 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1713,10 +1713,8 @@ 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));
- var nick = get_ccode_nick (prop);
- var blurb = get_ccode_blurb (prop);
- cspec.add_argument (new CCodeConstant ("\"%s\"".printf (nick)));
- cspec.add_argument (new CCodeConstant ("\"%s\"".printf (blurb)));
+ cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.nick)));
+ cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.blurb)));
if (prop.property_type.data_type is Class || prop.property_type.data_type is Interface) {