g_settings_bind: use canonical property name
authorRyan Lortie <desrt@desrt.ca>
Mon, 15 Oct 2012 23:28:28 +0000 (19:28 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 15 Oct 2012 23:28:28 +0000 (19:28 -0400)
commit1a20d56a894040e35153591c2d86513d5dddb409
tree3e4416530aa0002c2fc7b9765a94978052925e5a
parentdace477c92ea3a9111cef73159a6a1fcaaf0f497
g_settings_bind: use canonical property name

We were using the user-passed value of the @property argument for
several purposes in g_settings_bind(): error messages, binding
uniqueness (ie: one-binding-per-property-per-object) and most
importantly, connecting to the detailed notify:: signal.

The user may pass a string like "property_name" when the property's
canonical name is "property-name".  g_object_class_find_property() will
find the property under these circumstances, but a connection to
"notify::property_name" will not notice notifies emitted for
"property-name".

We can solve this by using the user's string to perform the lookup and
then using pspec->name for everything after that.

https://bugzilla.gnome.org/show_bug.cgi?id=684882
gio/gsettings.c