mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 23:58:54 +02:00
gobject: add 'explicit notify' GParamSpec flag
Add a flag to prevent the automatic emission of the "notify" signal during g_object_set_property(). If this flag is set then the class must explicitly emit the notify for themselves. This is already standard practice on most classes, but we cannot simply remove the existing behaviour because there are surely many cases where it is needed. https://bugzilla.gnome.org/show_bug.cgi?id=731200
This commit is contained in:
@@ -1380,14 +1380,17 @@ object_set_property (GObject *object,
|
||||
}
|
||||
else
|
||||
{
|
||||
GParamSpec *notify_pspec;
|
||||
|
||||
class->set_property (object, param_id, &tmp_value, pspec);
|
||||
|
||||
notify_pspec = get_notify_pspec (pspec);
|
||||
if (~pspec->flags & G_PARAM_EXPLICIT_NOTIFY)
|
||||
{
|
||||
GParamSpec *notify_pspec;
|
||||
|
||||
if (notify_pspec != NULL)
|
||||
g_object_notify_queue_add (object, nqueue, notify_pspec);
|
||||
notify_pspec = get_notify_pspec (pspec);
|
||||
|
||||
if (notify_pspec != NULL)
|
||||
g_object_notify_queue_add (object, nqueue, notify_pspec);
|
||||
}
|
||||
}
|
||||
g_value_unset (&tmp_value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user