Re: [gmime-devel] g_mime_message_foreach_part does not recurse



On Sat, 2008-09-06 at 11:01 -0400, Jeffrey Stedfast wrote:
> On Sat, 2008-09-06 at 14:11 +0300, djcb wrote:
> > Hi,
> > 
> > I am writing a maildir index & search program, and I use GMime for
> > parsing the messages. I try to determine the message body using
> > g_mime_message_foreach_part. However, it seems that function only gets
> > the parts on the current level, and does not recurse. Is that expected
> > behaviour. Maybe it should be documented?
> 
> The foreach functions (g_mime_message_foreach and
> g_mime_multipart_foreach) weren't designed to be recursive, however I
> can understand how it could be confusing and that my docs could
> certainly use some clarification.

After re-reading the docs I wrote for these functions, I'm wow'd by the
inaccuracy :p

Yea, these are definitely way more confusing than I realized at a first
glance yesterday.

It even turns out that the code in basic-example.c expected it to be
recursive.

> 
> For now, the solution is to check the GMimeObject type in the foreach
> callback function and if the part is a multipart, call
> g_mime_multipart_foreach() on it.
> 
> In the meantime, I'll think about changing the behavior of the foreach
> functions for the next stable series.

I'm currently working on changing the behavior of the foreach functions
to recurse. I don't think it really makes a whole lot of sense to not be
recursive after thinking about it a bit.

Thanks for bringing this API catastrophe to my attention ;)

Jeff




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]