[evolution-patches] Re: [Evolution-hackers] broken threading in mail-display



Not really complete, but i suppose it'll do for now.

On Thu, 2005-07-28 at 15:42 +0530, Srinivasa Ragavan wrote:
> Hope this fixes it.
> 
> -Srini
> On Thu, 2005-07-28 at 16:53 +0800, Not Zed wrote:
> > Srini,
> > 
> > Your attachment patch has busted the threading in the mail display.  The
> > UI can now lock for extended periods because it is doing camel
> > operations from the main thread.
> > 
> > This particular bit of code is at least one place where it is - and to
> > be honest, i'm completely baffled by it.  You're copying a whole part
> > into memory just to copy the part.  Thats what references are for.
> > 
> > Of course, I never got a chance to review this code since you just
> > committed it anyway, which was completely inappropriate to start with.
> > 
> > Fix it.
> > 
> > 
> > EAttachment *
> > e_attachment_new_from_mime_part (CamelMimePart *part)
> > {
> > 	EAttachment *new;
> > 	CamelMimePart *mime_part;
> > 	CamelStream *stream;
> > 	
> > 	g_return_val_if_fail (CAMEL_IS_MIME_PART (part), NULL);
> > 	
> > 	stream = camel_stream_mem_new ();
> > 	if (camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (part),
> > stream) == -1) {
> > 		camel_object_unref (stream);
> > 		return NULL;
> > 	}
> > 	
> > 	camel_stream_reset (stream);
> > 	mime_part = camel_mime_part_new ();
> > 	
> > 	if (camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER
> > (mime_part), stream) == -1) {
> > 		camel_object_unref (mime_part);
> > 		camel_object_unref (stream);
> > 		return NULL;
> > 	}
> > 	
> > 	camel_object_unref (stream);
> > 
> > _______________________________________________
> > evolution-hackers maillist  -  evolution-hackers lists ximian com
> > http://lists.ximian.com/mailman/listinfo/evolution-hackers




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