[glib/new-gsettings] Do not blindly fail if default mapping function can't handle the binding



commit 0b72c678c70ba53381107b7c3d01aa5dd6d55d1b
Author: Vincent Untz <vuntz gnome org>
Date:   Fri Apr 16 19:19:02 2010 -0400

    Do not blindly fail if default mapping function can't handle the binding
    
    It's perfectly okay to have no specific mapping function for get if the
    caller is not interested in get anyway.

 gio/gsettings.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gio/gsettings.c b/gio/gsettings.c
index 435716c..28476ae 100644
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@ -1623,7 +1623,8 @@ g_settings_bind_with_mapping (GSettings               *settings,
       return;
     }
 
-  if (get_mapping == NULL || set_mapping == NULL)
+  if ((get_mapping == NULL && (flags & G_SETTINGS_BIND_GET)) ||
+      (set_mapping == NULL && (flags & G_SETTINGS_BIND_SET)))
     {
       gboolean ok = FALSE;
 



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