GNOME Bugzilla – Bug 622281
binding: Add SYNC_CREATE to the flags
Last modified: 2010-06-23 14:21:07 UTC
A conceivable scenario of a GObject property binding is one where we want the target property to be synchronized with the source one at the moment of the binding creation, instead of waiting for the first change.
Created attachment 164209 [details] [review] binding: Add SYNC_CREATE to the flags When creating a binding between two object properties we might want to automatically synchronize the two values at the moment of the binding creation, instead of waiting for the next change. The G_BINDING_SYNC_CREATE flag does exactly what it says on the tin.
In gedit this is exactly what we need. When we split a document we need all the properties of the TextView sync at the creation of the Binding. So it would be much appreciated having this in.
Review of attachment 164209 [details] [review]: Looks fine to me, modulo the doc clarification ::: gobject/gbinding.h @@ +78,3 @@ * the other is updated + * @G_BINDING_SYNC_CREATE: Synchronize the values of the source and + * target properties when creating the binding. This should probably state which direction the initial sync goes for bidi bindings. source -> target ?
Review of attachment 164209 [details] [review]: Would also be good to have a test that explicitly checks the direction of the initial sync, I guess
Created attachment 164395 [details] [review] binding: Add SYNC_CREATE to the flags When creating a binding between two object properties we might want to automatically synchronize the two values at the moment of the binding creation, instead of waiting for the next change. The G_BINDING_SYNC_CREATE flag does exactly what it says on the tin.
patch attached for reference.
Attachment 164395 [details] pushed as f587cb5 - binding: Add SYNC_CREATE to the flags