After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 622281 - binding: Add SYNC_CREATE to the flags
binding: Add SYNC_CREATE to the flags
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-06-21 11:30 UTC by Emmanuele Bassi (:ebassi)
Modified: 2010-06-23 14:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
binding: Add SYNC_CREATE to the flags (4.11 KB, patch)
2010-06-21 11:30 UTC, Emmanuele Bassi (:ebassi)
accepted-commit_now Details | Review
binding: Add SYNC_CREATE to the flags (4.53 KB, patch)
2010-06-23 14:16 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Emmanuele Bassi (:ebassi) 2010-06-21 11:30:03 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.
Comment 1 Emmanuele Bassi (:ebassi) 2010-06-21 11:30:07 UTC
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.
Comment 2 Ignacio Casal Quinteiro (nacho) 2010-06-21 12:35:37 UTC
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.
Comment 3 Matthias Clasen 2010-06-23 13:56:48 UTC
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 ?
Comment 4 Matthias Clasen 2010-06-23 13:58:58 UTC
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
Comment 5 Emmanuele Bassi (:ebassi) 2010-06-23 14:16:26 UTC
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.
Comment 6 Emmanuele Bassi (:ebassi) 2010-06-23 14:17:11 UTC
patch attached for reference.
Comment 7 Emmanuele Bassi (:ebassi) 2010-06-23 14:21:04 UTC
Attachment 164395 [details] pushed as f587cb5 - binding: Add SYNC_CREATE to the flags