From c057ec2dd623ff81f08d3fb1ea483e30970c46a0 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 16 Apr 2010 17:33:43 -0400 Subject: [PATCH] Fix binding test failures --- gio/gsettings.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/gio/gsettings.c b/gio/gsettings.c index f540868ad..969e0357a 100644 --- a/gio/gsettings.c +++ b/gio/gsettings.c @@ -100,10 +100,24 @@ * schema CDATA #REQUIRED > * ]]> * ]| - */ - -/* TODO: - * Talk about schema naming conventions, explain child settings + * + * + * Binding + * + * A very convenient feature of GSettings lets you bind #GObject properties + * directly to settings, using g_settings_bind(). Once a GObject property + * has been bound to a setting, changes on either side are automatically + * propagated to the other side. + * + * + * This makes it very easy to hook up a preferences dialog to the + * underlying settings. To make this even more convenient, GSettings + * looks for a boolean property with the name "sensitivity" and + * automatically binds it to the writability of the bound setting. + * If this 'magic' gets in the way, it can be suppressed with the + * #G_SETTINGS_BIND_NO_SENSITIVITY flag. + * + * */ struct _GSettingsPrivate @@ -1081,11 +1095,13 @@ g_settings_binding_free (gpointer data) g_assert (!binding->running); - if (binding->key_handler_id) + if (g_signal_handler_is_connected (binding->settings, + binding->key_handler_id)) g_signal_handler_disconnect (binding->settings, binding->key_handler_id); - if (binding->property_handler_id) + if (g_signal_handler_is_connected (binding->object, + binding->property_handler_id)) g_signal_handler_disconnect (binding->object, binding->property_handler_id);