[vala/staging: 3/4] codegen: *Drop* support for non-auto property initializer in gobjects



commit 9adb86392347edb984842df444888f1916daa26a
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Apr 19 14:51:12 2018 +0200

    codegen: *Drop* support for non-auto property initializer in gobjects
    
    Partly reverts 73e553ac3488d641fb08b275bcf2636e3cf0de67
    https://bugzilla.gnome.org/show_bug.cgi?id=701978
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795225

 codegen/valagobjectmodule.vala |   21 ---------------------
 tests/Makefile.am              |    1 -
 tests/objects/bug701978.vala   |   22 ----------------------
 3 files changed, 0 insertions(+), 44 deletions(-)
---
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
index 82eba07..11aa6e6 100644
--- a/codegen/valagobjectmodule.vala
+++ b/codegen/valagobjectmodule.vala
@@ -688,27 +688,6 @@ public class Vala.GObjectModule : GTypeModule {
 
                if (is_gobject_property (prop) && prop.parent_symbol is Class) {
                        prop_enum.add_value (new CCodeEnumValue ("%s_PROPERTY".printf 
(get_ccode_upper_case_name (prop))));
-
-                       if (prop.initializer != null && prop.set_accessor != null && 
!prop.set_accessor.automatic_body) {
-                               // generate a custom initializer if it couldn't be done at class_init time
-                               bool has_spec_initializer = prop.property_type.data_type is Enum;
-                               if (!has_spec_initializer && prop.property_type.data_type is Struct) {
-                                       var param_spec_func = get_ccode_param_spec_function 
(prop.property_type.data_type);
-                                       has_spec_initializer = param_spec_func != "g_param_spec_boxed";
-                               }
-                               if (!has_spec_initializer) {
-                                       push_context (instance_init_context);
-
-                                       prop.initializer.emit (this);
-
-                                       var inst_ma = new MemberAccess.simple ("this");
-                                       inst_ma.target_value = new GLibValue (get_data_type_for_symbol 
((Class) prop.parent_symbol), new CCodeIdentifier ("self"), true);
-                                       store_property (prop, inst_ma, prop.initializer.target_value);
-
-                                       temp_ref_values.clear ();
-                                       pop_context ();
-                               }
-                       }
                }
        }
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index de61c58..5ec1473 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -286,7 +286,6 @@ TESTS = \
        objects/bug681356.vala \
        objects/bug683646.vala \
        objects/bug695671.vala \
-       objects/bug701978.vala \
        objects/bug702736.vala \
        objects/bug702846.vala \
        objects/bug731547.vala \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]