allow object classes to override signal connect/disconnect
Submitted by Allison (desrt)
Link to original bug (#380581)
Description
as a gobject subclass i might be interested in handling signal connect/disconnect for myself.
i may, for example want to block a connect from occuring.
or (and this is the immediate intended use) i may want to know when connects/disconnects happen. in this case i'd override the default implementation and chain my parent implementation from my handler. my handler would also be able to do other things.
this is useful because there might be quite some hard work involved in generating signals. consider the rationale behind g_signal_has_handler_pending. this exists because sometimes it is hard to calculate arguments to a signal and therefore it would be better to just not emit it at all. sometimes, though, it is difficult to even know when a signal should be sent at all since you have to setup some sort of a poll/watch which allows you to emit the signal. if you know that nobody is watching you can avoid doing this, but you need to be told when someone does start watching.
the most immediate example is the GtkRecentManager thing. it sends this "changed" signal when the recent list has been updated. in order to do this, however, it has to monitor the list (currently by polling it with stat). if nobody is watching "changed" then this is wasteful.