GNOME Bugzilla – Bug 673693
entrycompletion: set_property() should use property setter functions
Last modified: 2012-10-18 08:08:33 UTC
gtk_entry_completion_set_property() sets values in 'priv' directly, bypassing notificationand invocation and possibly other actions done by gtk_set_xxx() functions. This effectively causes that gtk_entry_completion_set_xprop () and gobject_set(..., 'xprop') behave differently.
Created attachment 211547 [details] [review] entrycompletion: set_property() should invoke object::notify signal gtk_entry_completion_set_property() was setting many properties by directly modifying priv values, bypassing notification invocation and possibly another actions done by gtk_completion_entry_set_xxx () functions. Fix by invoking set_xxx() instead of setting the property value directly.
g_object_set() will implicitly call g_object_notify() - the double notification is avoided because GObject compresses notifications on the same property. it's a good thing, though, to have set_property() call the proper setters - as it unifies the code paths and adds the same constraints on the properties modified, including the notification on multiple properties.
(In reply to comment #2) > g_object_set() will implicitly call g_object_notify() - the double notification > is avoided because GObject compresses notifications on the same property. I see, thanks. I'll attach revised version of the patch with better description which does not talk about ::notify signal any more.
Created attachment 211569 [details] [review] entrycompletion: set_property() should call property setters A new version of the patch with improved description not mentioning ::notify signal.
Review of attachment 211569 [details] [review]: looks good to me.
Attachment 211569 [details] pushed as 331bba1 - entrycompletion: set_property() should call property setters
This broke documented GtkEntryCompletion behaviour: * This functions creates and adds a #GtkCellRendererText for the selected * column. If you need to set the text column, but don't want the cell * renderer, use g_object_set() to set the #GtkEntryCompletion:text-column * property directly. If you wondered why the completion popup in the file chooser has been showing you everything twice recently, this is why :-(
IMHO, even when documented, this is very strange behaviour and violates principle of the least surprise. With documented (and now enforced) behaviour, setting text-column using g_object_set() in simple common cases (similar to the one in gtk-demo) causes hard-to-understand crashes when the popup is about to appear. IMHO it would be better to have specialised method for 'raw' setting of the text_column field instead of overloading g_object_set() semantics.