Changeset 3754

Show
Ignore:
Timestamp:
09/03/08 11:11:43
Author:
svillar
Message:

Do not add a message retrieval (with both get_msg_async and find_msg_async) to the IMAP store account message retrieval queue when there is a pending connection in the account queue.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3753 r3754  
     12008-09-03  Sergio Villar Senin  <svillar@igalia.com> 
     2 
     3        * libtinymail-camel/tny-camel-folder.c 
     4        (tny_camel_folder_get_msg_async_default), 
     5        (tny_camel_folder_find_msg_async_default): 
     6        * libtinymail-camel/tny-camel-queue-priv.h: 
     7        * libtinymail-camel/tny-camel-queue.c (_tny_camel_queue_has_items): 
     8        * libtinymail-camel/tny-camel-store-account.c 
     9        (_tny_camel_store_account_queue_going_online): do not add a 
     10        message retrieval (with both get_msg_async and find_msg_async) to 
     11        the IMAP store account message retrieval queue when there is a 
     12        pending connection in the account queue. 
     13 
    1142008-08-31  Rob Taylor  <rob.taylor@codethink.co.uk> 
    215 
  • trunk/libtinymail-camel/tny-camel-folder.c

    r3749 r3754  
    26702670        g_object_ref (info->header); 
    26712671 
    2672         if (!TNY_IS_CAMEL_POP_FOLDER (self)) 
     2672        if (!TNY_IS_CAMEL_POP_FOLDER (self) &&  
     2673            !_tny_camel_queue_has_items (TNY_FOLDER_PRIV_GET_QUEUE (priv),  
     2674                                         TNY_CAMEL_QUEUE_RECONNECT_ITEM | TNY_CAMEL_QUEUE_CONNECT_ITEM)) 
    26732675                queue = TNY_FOLDER_PRIV_GET_MSG_QUEUE (priv); 
    26742676        else 
     
    28462848        g_object_ref (info->self); 
    28472849 
    2848         if (!TNY_IS_CAMEL_POP_FOLDER (self)) 
     2850        if (!TNY_IS_CAMEL_POP_FOLDER (self) &&  
     2851            !_tny_camel_queue_has_items (TNY_FOLDER_PRIV_GET_QUEUE (priv),  
     2852                                         TNY_CAMEL_QUEUE_RECONNECT_ITEM | TNY_CAMEL_QUEUE_CONNECT_ITEM)) 
    28492853                queue = TNY_FOLDER_PRIV_GET_MSG_QUEUE (priv); 
    28502854        else 
  • trunk/libtinymail-camel/tny-camel-queue-priv.h

    r3672 r3754  
    7575        TNY_CAMEL_QUEUE_REFRESH_ITEM = 1<<6, 
    7676        TNY_CAMEL_QUEUE_AUTO_CANCELLABLE_ITEM = 1<<7, 
     77        TNY_CAMEL_QUEUE_CONNECT_ITEM = 1<<8, 
    7778} TnyCamelQueueItemFlags; 
    7879 
     
    8485void _tny_camel_queue_remove_items (TnyCamelQueue *queue, TnyCamelQueueItemFlags flags); 
    8586void _tny_camel_queue_cancel_remove_items (TnyCamelQueue *queue, TnyCamelQueueItemFlags flags); 
     87gboolean _tny_camel_queue_has_items (TnyCamelQueue *queue, TnyCamelQueueItemFlags flags); 
    8688 
    8789G_END_DECLS 
  • trunk/libtinymail-camel/tny-camel-queue.c

    r3704 r3754  
    487487                cancel_field, data, data_size, TNY_CAMEL_QUEUE_NORMAL_ITEM, name); 
    488488        return; 
     489} 
     490 
     491gboolean  
     492_tny_camel_queue_has_items (TnyCamelQueue *queue, TnyCamelQueueItemFlags flags) 
     493{ 
     494        GList *copy = NULL; 
     495        gboolean retval = FALSE; 
     496 
     497        g_static_rec_mutex_lock (queue->lock); 
     498        copy = queue->list; 
     499        while (copy) 
     500        { 
     501                QueueItem *item = copy->data; 
     502 
     503                if (item && (item->flags & flags))  
     504                { 
     505                        tny_debug ("TnyCamelQueue: %s found\n", item->name); 
     506                        retval = TRUE; 
     507                        break; 
     508                } 
     509                 
     510                copy = g_list_next (copy); 
     511        } 
     512        g_static_rec_mutex_unlock (queue->lock); 
     513 
     514        return retval; 
    489515} 
    490516 
  • trunk/libtinymail-camel/tny-camel-store-account.c

    r3748 r3754  
    20552055                NULL, 
    20562056                info, sizeof (GoingOnlineInfo), 
    2057                 TNY_CAMEL_QUEUE_RECONNECT_ITEM|TNY_CAMEL_QUEUE_CANCELLABLE_ITEM, 
     2057                TNY_CAMEL_QUEUE_CONNECT_ITEM|TNY_CAMEL_QUEUE_CANCELLABLE_ITEM, 
    20582058                __FUNCTION__); 
    20592059