[beast] BSE: work around regressions introduced in g_object_class_install_property



commit 545b1cd2ffb9d253aa81bff754b5b622a39fcfbb
Author: Tim Janik <timj gnu org>
Date:   Mon Oct 22 17:56:43 2012 +0200

    BSE: work around regressions introduced in  g_object_class_install_property
    
    See Gnome bug #686652, g_object_class_install_property falsely forces
    properties to be readable or writable.

 bse/bseinstrumentinput.cc  |   16 +++++++++++++++-
 bse/bseinstrumentoutput.cc |   16 +++++++++++++++-
 bse/bsemidisynth.c         |    2 +-
 bse/bsesong.c              |    2 +-
 4 files changed, 32 insertions(+), 4 deletions(-)
---
diff --git a/bse/bseinstrumentinput.cc b/bse/bseinstrumentinput.cc
index f45f59a..1a36d7b 100644
--- a/bse/bseinstrumentinput.cc
+++ b/bse/bseinstrumentinput.cc
@@ -93,8 +93,20 @@ bse_instrument_input_set_parent (BseItem *item,
 }
 
 static void
+bse_instrument_input_get_property (GObject *object, uint param_id, GValue *value, GParamSpec *pspec)
+{
+  switch (param_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+      break;
+    }
+}
+
+static void
 bse_instrument_input_class_init (BseInstrumentInputClass *klass)
 {
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   BseObjectClass *object_class = BSE_OBJECT_CLASS (klass);
   BseItemClass *item_class = BSE_ITEM_CLASS (klass);
   BseSourceClass *source_class = BSE_SOURCE_CLASS (klass);
@@ -102,6 +114,7 @@ bse_instrument_input_class_init (BseInstrumentInputClass *klass)
   
   parent_class = g_type_class_peek_parent (klass);
   
+  gobject_class->get_property = bse_instrument_input_get_property;
   item_class->set_parent = bse_instrument_input_set_parent;
   
   /* assert parent class introduced enough ports */
@@ -111,7 +124,8 @@ bse_instrument_input_class_init (BseInstrumentInputClass *klass)
     {
       char *string = g_strdup_printf ("in_port_%u", i + 1);
       bse_object_class_add_param (object_class, NULL, PROP_IPORT_NAME + i * 2,
-				  sfi_pspec_string (string, NULL, NULL, NULL, NULL));
+				  sfi_pspec_string (string, NULL, NULL, NULL,
+                                                    /* override parent property: 0 */ "r"));
       g_free (string);
     }
 
diff --git a/bse/bseinstrumentoutput.cc b/bse/bseinstrumentoutput.cc
index 30ca9f2..ea444b4 100644
--- a/bse/bseinstrumentoutput.cc
+++ b/bse/bseinstrumentoutput.cc
@@ -93,8 +93,20 @@ bse_instrument_output_set_parent (BseItem *item,
 }
 
 static void
+bse_instrument_output_get_property (GObject *object, uint param_id, GValue *value, GParamSpec *pspec)
+{
+  switch (param_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+      break;
+    }
+}
+
+static void
 bse_instrument_output_class_init (BseInstrumentOutputClass *klass)
 {
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   BseObjectClass *object_class = BSE_OBJECT_CLASS (klass);
   BseItemClass *item_class = BSE_ITEM_CLASS (klass);
   BseSourceClass *source_class = BSE_SOURCE_CLASS (klass);
@@ -102,6 +114,7 @@ bse_instrument_output_class_init (BseInstrumentOutputClass *klass)
   
   parent_class = g_type_class_peek_parent (klass);
   
+  gobject_class->get_property = bse_instrument_output_get_property;
   item_class->set_parent = bse_instrument_output_set_parent;
   
   /* assert parent class introduced enough ports */
@@ -111,7 +124,8 @@ bse_instrument_output_class_init (BseInstrumentOutputClass *klass)
     {
       char *string = g_strdup_printf ("out_port_%u", i + 1);
       bse_object_class_add_param (object_class, NULL, PROP_OPORT_NAME + i * 2,
-				  sfi_pspec_string (string, NULL, NULL, NULL, NULL));
+				  sfi_pspec_string (string, NULL, NULL, NULL,
+                                                    /* override parent property: 0 */ "r"));
       g_free (string);
     }
   
diff --git a/bse/bsemidisynth.c b/bse/bsemidisynth.c
index 26c9e21..090d2b1 100644
--- a/bse/bsemidisynth.c
+++ b/bse/bsemidisynth.c
@@ -481,5 +481,5 @@ bse_midi_synth_class_init (BseMidiSynthClass *class)
 			      PROP_AUTO_ACTIVATE,
 			      sfi_pspec_bool ("auto_activate", NULL, NULL,
 					      TRUE, /* change default */
-					      /* override parent property */ 0));
+					      /* override parent property: 0 */ "w"));
 }
diff --git a/bse/bsesong.c b/bse/bsesong.c
index 76c7a5e..6cb48a0 100644
--- a/bse/bsesong.c
+++ b/bse/bsesong.c
@@ -780,7 +780,7 @@ bse_song_class_init (BseSongClass *class)
 			      PROP_AUTO_ACTIVATE,
 			      sfi_pspec_bool ("auto_activate", NULL, NULL,
 					      TRUE, /* change default */
-					      /* override parent property */ 0));
+					      /* override parent property: 0 */ "w"));
   bse_object_class_add_param (object_class, _("Looping"),
 			      PROP_LOOP_ENABLED,
 			      sfi_pspec_bool ("loop_enabled", NULL, NULL,



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