property binding: support holding ref on source
Submitted by Allison (desrt)
Link to original bug (#699634)
Description
Pretty simple usecase here: I have a label or other widget that is showing a property from some underlying object. I don't care about the underlying object existing other than that it needs to emit notify signals to tell me when the label needs to be updated. Once the label is gone, I want the underlying object to go away.
ie: pretty much straight-up model/view with change notification.
For this reason we should support bindings that are defined only by the lifetime of the target. Instead of being destroyed when the source object goes away, they will rather hold a ref on the source and keep it alive for as long as the binding exists (which will be defined by the life of the target).
We could do this as a flag. It seems a bit weird to have a flag that changes the refcounting behaviour of a function but this isn't really the case here (ie: we are not changing the 'transfer' of the API at all -- just adding another ref or not), so I think it's actually pretty sane.