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.
This commit is contained in:
Vincent Untz 2010-04-16 19:19:02 -04:00
parent 2a1e228408
commit 0b72c678c7

View File

@ -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;