|GMime 2.4 Reference Manual|
Changes from 1.0 to 2.0
Changes from 1.0 to 2.0 — Incompatible changes made between version 1.0 and version 2.0
See also the PORTING document in the toplevel GMime source directory.
The major change here is that I've dropped my own base object class and have replaced it with GObject from glib-2.0. This should be a pleasant change since you (the developer) will now be able to do many more things such as setting arbitrary data on all GMime objects. For additional information about GObject, please see the GObject Reference Manual at http://developer.gnome.org/doc/API/2.0/gobject/
The first thing you need to know is that any function returning a
non-const pointer to any object /must/ be unref'd when you are done
with it. Since all objects in GMime now subclass GObject, you may
(GMimeStream's may also be unref'd using
g_mime_stream_unref(), but either way is fine).
Don't forget that
g_mime_part_get_content_object() returns a
ref-counted GMimeDataWrapper object now, and
so you /must/ unref it when you have finished using it. You must also
remember to unref any GMimeDataWrapper object that you /set/ on a
as the GMimePart will now ref the content object that you set on it.
GMimeMultipart is a new class which is to be used for all multipart MIME parts rather than GMimePart (as in 1.0). There are also some subclasses of GMimeMultipart for other things.
g_mime_part_[g,s]et_boundary() have been removed
(see above). You must now create a GMimeMultipart object and use
g_mime_part_add_subpart() has been replaced with
g_mime_part_foreach() has been replaced with
been replaced with
Another new class is GMimeMessagePart which is to be used for all MIME parts containing an rfc822 message. All 1.0 GMimePart's representing message/rfc822 parts (as well as message/news parts?) need to be migrated over to be GMimeMessagePart objects.
GMimeMessagePartial is another class meant for handling the message/partial MIME type. All 1.0 GMimePart's holding data of this type should be replaced with GMimeMessagePartial objects.
g_mime_part_write_to_stream() functions have been
consolidated into a virtual method. Replace calls to these functions
g_mime_object_write_to_stream(). Note: while
g_mime_message_write_to_stream() still exist, it
is suggested you migrate to
g_mime_object_write_to_stream(). Same goes for
GMimeMessage's structure has changed a
bit. You will not be able to do
instead you want to do
g_mime_message_set_message_id() now takes a
message_id argument without the encapsulating < and >'s (it now
just takes the addr-spec portion of the msg-id).
GMimeFilterFrom has changed slightly, you
will want to replace all calls to
GMIME_FILTER_FROM_MODE_DEFAULT is equivalent to (int) 0).
GMimeParser is a brand new class and
gmime-parser.h has had a number of API additions.
g_mime_parser_construct_message() still exist,
however they no longer take a GMimeStream argument. Instead, they take
a GMimeParser object.