GObject signals

Sean Egan seanegan at gmail.com
Tue Jun 24 17:35:44 EDT 2008


On Tue, Jun 24, 2008 at 2:26 PM, Sadrul Habib Chowdhury
<imadil at gmail.com> wrote:
> A very simple solution would be to have a PurpleModule object for each
> module (e.g. PurpleModuleAccount etc.). This will replace the current
> usage of 'handle'. So, if something is interested in an event on any
> object from a module, it connects to the corresponding signal for that
> module (instead of connecting to the signal on an object). With this fix,
> every event will trigger two signals, one on the object, and one on the
> module. The callbacks can connect to whichever one it wants to. Does this
> sound like a good solution? (If you are following the .gobjectification
> branch, you may have noticed that there's a PurpleAccountManager object,
> which can act as the PurpleModuleAccount)

I think the way we've been doing this so far is to have
PurpleFooManager singletons that manage the global list of objects and
can emit signals whenever any of its objects want. This is the case
for PurpleMedia, at least. In your example, there'd be
PurpleAccountManager that would be a factory for accounts, own all the
purple_accounts_foo functions and emit signals for them.

-s.




More information about the Devel mailing list