Changeset 3758

Show
Ignore:
Timestamp:
09/05/08 00:00:41
Author:
jdapena
Message:

* libtinymail-camel/tny-camel-mime-part.c

(tny_camel_mime_part_decode_to_stream_async_default): make it really
asynchronous, doing the operation in a separate thread.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/modest/diablo-pe2/ChangeLog

    r3755 r3758  
     12008-09-03  Jose Dapena Paz  <jdapena@igalia.com> 
     2 
     3        * libtinymail-camel/tny-camel-mime-part.c 
     4        (tny_camel_mime_part_decode_to_stream_async_default): make it really 
     5        asynchronous, doing the operation in a separate thread. 
     6 
    172008-09-03  Sergio Villar Senin  <svillar@igalia.com> 
    28 
  • releases/modest/diablo-pe2/libtinymail-camel/tny-camel-mime-part.c

    r3667 r3758  
    302302} 
    303303 
    304 /* This one is just to fulfil the API requirements */ 
     304static gpointer 
     305decode_to_stream_async_thread (gpointer userdata) 
     306
     307        DecodeAsyncInfo *info = (DecodeAsyncInfo *) userdata; 
     308 
     309        tny_mime_part_decode_to_stream (info->self, info->stream, &(info->err)); 
     310 
     311        g_idle_add_full (G_PRIORITY_HIGH,  
     312                         decode_async_callback,  
     313                         info, decode_async_destroyer); 
     314        return NULL; 
     315 
     316
    305317 
    306318static void 
     
    315327{ 
    316328        DecodeAsyncInfo *info = g_slice_new0 (DecodeAsyncInfo); 
    317  
    318         tny_mime_part_decode_to_stream (self, stream, NULL); 
    319329 
    320330        info->self = g_object_ref (self); 
     
    324334        info->err = NULL; 
    325335 
    326         g_idle_add_full (G_PRIORITY_HIGH,  
    327                                decode_async_callback,  
    328                                info, decode_async_destroyer); 
    329  
     336        if (g_thread_create (decode_to_stream_async_thread, info, FALSE, &(info->err)) == FALSE) { 
     337                g_critical ("%s failed: couldn't create the working thread", __FUNCTION__); 
     338        } 
     339                 
    330340        return; 
    331341}