Re: [Evolution-hackers] Proposed fix for bug 311512
- From: Karl Relton <karllinuxtest relton ntlworld com>
- To: Jeffrey Stedfast <fejj novell com>
- Cc: evolution-hackers gnome org
- Subject: Re: [Evolution-hackers] Proposed fix for bug 311512
- Date: Thu, 26 Apr 2007 15:41:51 +0100
On Thu, 2007-04-26 at 09:29 -0400, Jeffrey Stedfast wrote:
> > Yes - I had thought of this too.
> >
> > The trouble is with the current code its not quite so simple AFAIK. The
> > filtering that takes place is actually launched from the
> > folder_changed() function in camel-folder.c. In other words, it is
> > launched from the folder_changed event handler itself. Now I may be
> > wrong here, but my assumption is that both evo and e-d-s register event
> > handlers on this type of event - so that when such an event occurs code
> > in both evo and e-d-s is executed ... perhaps even in parallel (in their
> > own threads)?
>
> not completely correct...
>
> when you trigger an event on a CamelObject, it first fires the "prep"
> callback, which is what camel-folder.c:folder_changed() is (note that it
> returns bool)
>
> A prep event handler is the first handler called (event handlers are
> fired sequentially, in order of connection - /not/ in parallel) and gets
> to decide if the event propagates by returning TRUE (or FALSE if it
> should be blocked - that's how freeze/thaw works).
>
> >
> > If this is the case, then it is effectively too late to 'trap' the
> > event, because evo will already be processing it.
>
> all the event handler has to do is return FALSE to block other event
> handlers from firing :)
>
> > Thus (AFAICS) even if
> > camel is in a 'freeze' for folder_changed events, evo will still be
> > firing on every folder_changed occurence.
>
> only if folder_changed() returns TRUE - folder_changed() is what checks
> if the folder is in a freeze state, and if it is blocks further events
> from firing (by returning FALSE).
>
> You have da powah!
>
> >
> > One way to solve that would be to change things so that evo only fires
> > when camel folder_changed stuff has really done: effectively at the end
> > of a freeze AND filtering. That could be done by introducing a new event
> > and making evo trigger off that perhaps?
>
> unnecessary. all the tools are already available :)
>
Excellent - many thanks for correcting me on my understanding. I'll look
into it more to see how this can be worked up. Give me a couple of
weeks, and I'll come back if I find I need more understanding.
Karl
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]