[anjal] Make Anjal compilable for 2.27.x



commit d58f2556e61c5ec0c721f0d0dcbbc8c79bc63407
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Tue May 5 14:20:28 2009 +0530

    Make Anjal compilable for 2.27.x
---
 src/em-format-webkit-display.c |   27 +++++++++++++++++++++------
 1 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/src/em-format-webkit-display.c b/src/em-format-webkit-display.c
index 4e46415..a79c2d5 100644
--- a/src/em-format-webkit-display.c
+++ b/src/em-format-webkit-display.c
@@ -1999,14 +1999,14 @@ efwd_attachment_button(EMFormatWebKit *efh, GtkWidget*eb, EMFormatWebKitPObject
 		}
 	} else {
 		GdkPixbuf *pixbuf, *mini;
-
+/*
 		if ((pixbuf = e_icon_for_mime_type (simple_type, 24))) {
 			if ((mini = e_icon_factory_pixbuf_scale (pixbuf, 24, 24))) {
 				gtk_image_set_from_pixbuf ((GtkImage *) w, mini);
 				g_object_unref (mini);
 			}
 			g_object_unref (pixbuf);
-		}
+		}*/
 	}
 
 	drag_types[0].target = simple_type;
@@ -2144,19 +2144,29 @@ efwd_create_attachment_cache (EAttachment *attachment)
 
 	CamelContentType *content_type;
 
+#ifdef EVOLUTION_2_26
 	if (!attachment->body)
+#else
+	if (!e_attachment_get_mime_part(attachment))
+#endif		
 		return;
 
+#ifdef EVOLUTION_2_26
 	content_type = camel_mime_part_get_content_type (attachment->body);
-
+#else
+	content_type = camel_mime_part_get_content_type (e_attachment_get_mime_part(attachment));
+#endif	
 	if (camel_content_type_is(content_type, "image", "*")) {
 		CamelDataWrapper *wrapper;
 		CamelStreamMem *mstream;
 		GdkPixbufLoader *loader;
 		gboolean error = TRUE;
 		GdkPixbuf *pixbuf;
-
+#ifdef EVOLUTION_2_26
 		wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (attachment->body));
+#else
+		wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (e_attachment_get_mime_part(attachment)));
+#endif		
 		mstream = (CamelStreamMem *) camel_stream_mem_new ();
 
 		camel_data_wrapper_decode_to_stream (wrapper, (CamelStream *) mstream);
@@ -2165,7 +2175,7 @@ efwd_create_attachment_cache (EAttachment *attachment)
 		loader = gdk_pixbuf_loader_new ();
 		error = !gdk_pixbuf_loader_write (loader, mstream->buffer->data, mstream->buffer->len, NULL);
 		gdk_pixbuf_loader_close (loader, NULL);
-
+/*
 		if (!error) {
 			pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
 			attachment->pixbuf_cache = scale_pixbuf (pixbuf);
@@ -2175,7 +2185,7 @@ efwd_create_attachment_cache (EAttachment *attachment)
 			attachment->pixbuf_cache = NULL;
 			g_warning ("GdkPixbufLoader Error");
 		}
-
+*/
 		/* Destroy everything */
 		g_object_unref (loader);
 		camel_object_unref (mstream);
@@ -2196,7 +2206,12 @@ efwd_format_attachment(EMFormat *emf, CamelStream *stream, CamelMimePart *part,
 	info->shown = em_format_is_inline(emf, info->puri.part_id, info->puri.part, handle);
 	info->snoop_mime_type = emf->snoop_mime_type;
 	info->mime_type = g_strdup (mime_type);
+#ifdef EVOLUTION_2_26	
 	info->attachment = e_attachment_new_from_mime_part (info->puri.part);
+#else
+	info->attachment = e_attachment_new ();
+	e_attachment_set_mime_part (info->attachment, info->puri.part);
+#endif	
 	efwd_create_attachment_cache (info->attachment);
 	if (emf->valid) {
 		info->sign = emf->valid->sign.status;



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