Re: [gmime-devel] g_mime_message_foreach_part does not recurse



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.

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.

Jeff




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