[pan2: 26/68] Add support for compiling with gmime-2.5.



commit ea5e43cdfdb74c0824d60a7a7eae02d3a19c2bf8
Author: K. Haley <haleykd users sf net>
Date:   Fri May 28 22:06:54 2010 -0600

    Add support for compiling with gmime-2.5.

 configure.in                   |    3 ++-
 pan/gui/body-pane.cc           |    2 +-
 pan/gui/post-ui.cc             |   12 +++++++++++-
 pan/usenet-utils/mime-utils.cc |    2 +-
 4 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/configure.in b/configure.in
index c3a0d44..0c87386 100644
--- a/configure.in
+++ b/configure.in
@@ -49,7 +49,8 @@ AM_GLIB_GNU_GETTEXT
 panlocaledir='${prefix}/${DATADIRNAME}/locale'
 
 AM_PATH_GLIB_2_0($GLIB_REQUIRED,,exit 1,gobject gmodule gthread)
-PKG_CHECK_MODULES(GMIME, gmime-2.4    >= $GMIME_REQUIRED)
+PKG_CHECK_MODULES([GMIME], [ gmime-2.6    >= $GMIME_REQUIRED ], [],
+	[PKG_CHECK_MODULES( [GMIME], [gmime-2.4    >= $GMIME_REQUIRED] )] )
 AM_PATH_GTK_2_0($GTK_REQUIRED,,exit 1,gthread)
 
 
diff --git a/pan/gui/body-pane.cc b/pan/gui/body-pane.cc
index 04a9ce3..7643e16 100644
--- a/pan/gui/body-pane.cc
+++ b/pan/gui/body-pane.cc
@@ -803,7 +803,7 @@ namespace
    * Generates a GtkPixmap object from a given GMimePart that contains an image.
    * Used for displaying attached pictures inline.
    */
-  GdkPixbuf* get_pixbuf_from_gmime_part (const GMimePart * part)
+  GdkPixbuf* get_pixbuf_from_gmime_part (GMimePart * part)
   {
     GdkPixbufLoader * l (gdk_pixbuf_loader_new ());
     GError * err (0);
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 2530f57..01025fc 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -1472,6 +1472,16 @@ PostUI :: utf8ize (const StringView& in) const
   return content_to_utf8 (in, _charset.c_str(), local_charset);
 }
 
+#if GMIME_MINOR_VERSION == 4
+namespace {
+  inline GMimeStream* gmime_header_list_get_stream(GMimeHeaderList *hl)
+  {
+    // the name of this function was changed for 2.6
+    return gmime_header_list_has_raw(hl);
+  }
+}
+#endif
+
 void
 PostUI :: set_message (GMimeMessage * message)
 {
@@ -1506,7 +1516,7 @@ PostUI :: set_message (GMimeMessage * message)
   const char *name, *value;
   GMimeHeaderIter iter;
   
-  if (message->mime_part && g_mime_header_list_has_raw (message->mime_part->headers)) {
+  if (message->mime_part && g_mime_header_list_get_stream (message->mime_part->headers)) {
     if (g_mime_header_list_get_iter (message->mime_part->headers, &iter)) {
       do {
         value = g_mime_header_iter_get_value (&iter);
diff --git a/pan/usenet-utils/mime-utils.cc b/pan/usenet-utils/mime-utils.cc
index 051a429..95aded5 100644
--- a/pan/usenet-utils/mime-utils.cc
+++ b/pan/usenet-utils/mime-utils.cc
@@ -1201,7 +1201,7 @@ namespace
 namespace
 {
   char *
-  pan_g_mime_part_get_content (const GMimePart *mime_part, size_t *len)
+  pan_g_mime_part_get_content (GMimePart *mime_part, size_t *len)
   {
     char *retval = NULL;
 



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