[vala] codegen: Do not use g_object_class_override_property
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Do not use g_object_class_override_property
- Date: Tue, 24 Jan 2012 15:13:15 +0000 (UTC)
commit 1bff29257fa05bf9839583a56f22a1429ea7da73
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Jan 20 15:31:17 2012 -0500
codegen: Do not use g_object_class_override_property
Instead, always install our own new property with what we believe the
correct type is. This avoids a problem with libgee providing properties
on some classes that implement two interfaces having the same property
name with different types.
Fixes bug 666728.
codegen/valagobjectmodule.vala | 21 ++++++---------------
1 files changed, 6 insertions(+), 15 deletions(-)
---
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
index 6c70119..baa4256 100644
--- a/codegen/valagobjectmodule.vala
+++ b/codegen/valagobjectmodule.vala
@@ -139,21 +139,12 @@ public class Vala.GObjectModule : GTypeModule {
ccode.add_statement (new CCodeComment (prop.comment.content));
}
- if (prop.overrides || prop.base_interface_property != null) {
- var cinst = new CCodeFunctionCall (new CCodeIdentifier ("g_object_class_override_property"));
- cinst.add_argument (ccall);
- cinst.add_argument (new CCodeConstant (get_ccode_upper_case_name (prop)));
- cinst.add_argument (get_property_canonical_cconstant (prop));
-
- ccode.add_expression (cinst);
- } else {
- var cinst = new CCodeFunctionCall (new CCodeIdentifier ("g_object_class_install_property"));
- cinst.add_argument (ccall);
- cinst.add_argument (new CCodeConstant (get_ccode_upper_case_name (prop)));
- cinst.add_argument (get_param_spec (prop));
-
- ccode.add_expression (cinst);
- }
+ var cinst = new CCodeFunctionCall (new CCodeIdentifier ("g_object_class_install_property"));
+ cinst.add_argument (ccall);
+ cinst.add_argument (new CCodeConstant (get_ccode_upper_case_name (prop)));
+ cinst.add_argument (get_param_spec (prop));
+
+ ccode.add_expression (cinst);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]