Changeset 3406

Show
Ignore:
Timestamp:
02/15/08 17:33:51
Author:
pvanhoof
Message:

2008-02-15 Philip Van Hoof <pvanhoof@gnome.org>

        • Merged Alberto's cancel patch of yesterday with some minor

corrections and committed the patch

2008-02-14 Alberto Garcia Gonzalez <agarcia@igalia.com>

        • libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.[ch]:

Added new attribute: cancel_occurred
(imap_update_summary): Set cancel_occurred to TRUE when the
operation is cancelled by the user.
(camel_imap_folder_selected): Don't try to refresh the folder
again if a cancel has happened.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3400 r3406  
     12008-02-15  Philip Van Hoof <pvanhoof@gnome.org> 
     2 
     3        * Merged Alberto's cancel patch of yesterday with some minor 
     4        corrections and committed the patch 
     5 
     62008-02-14  Alberto Garcia Gonzalez <agarcia@igalia.com> 
     7 
     8        * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.[ch]: 
     9        Added new attribute: cancel_occurred 
     10        (imap_update_summary): Set cancel_occurred to TRUE when the 
     11        operation is cancelled by the user. 
     12        (camel_imap_folder_selected): Don't try to refresh the folder 
     13        again if a cancel has happened. 
     14 
    1152008-02-12  Alberto Garcia Gonzalez <agarcia@igalia.com> 
    216 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c

    r3386 r3406  
    248248        imap_folder->stopping = FALSE; 
    249249        imap_folder->in_idle = FALSE; 
     250        imap_folder->cancel_occurred = FALSE; 
    250251 
    251252        imap_folder->gmsgstore = NULL; 
     
    751752                } 
    752753 
    753                 if (imap_folder->need_rescan) { 
     754                if (imap_folder->need_rescan && !imap_folder->cancel_occurred) { 
    754755                        suc = imap_rescan (folder, exists, ex); 
    755                         if (imap_folder->need_rescan
     756                        if (imap_folder->need_rescan && !imap_folder->cancel_occurred
    756757                                camel_imap_folder_changed (folder, exists, NULL, ex); 
    757                 } else if (exists > count
     758                } else if (exists > count && !imap_folder->cancel_occurred
    758759                        camel_imap_folder_changed (folder, exists, NULL, ex); 
     760 
     761                imap_folder->cancel_occurred = FALSE; 
    759762        } else { 
    760763                /* Wow, this IMAP server rocks! it has QRESYNC! Hi there Isode!*/ 
     
    776779                camel_folder_change_info_free(changes); 
    777780        } 
    778  
    779781} 
    780782 
     
    32453247        if (!camel_imap_command_start (store, folder, ex, 
    32463248                "UID SEARCH %d:%d ALL", seq + 1, MAX (1, MIN (seq + 1 + nextn, exists)))) 
    3247                 { if (!camel_operation_cancel_check (NULL)) 
    3248                         g_warning ("IMAP error getting UIDs (1)"); 
    3249                  camel_operation_end (NULL); return; } 
     3249                { 
     3250                        if (camel_operation_cancel_check (NULL)) 
     3251                                imap_folder->cancel_occurred = TRUE; 
     3252                        else 
     3253                                g_warning ("IMAP error getting UIDs (1)"); 
     3254                        camel_operation_end (NULL); 
     3255                        return; 
     3256                } 
    32503257 
    32513258        more = FALSE; 
     
    32553262        if (cnt == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) 
    32563263        { 
    3257                 if (!camel_operation_cancel_check (NULL)) 
     3264                if (camel_operation_cancel_check (NULL)) 
     3265                        imap_folder->cancel_occurred = TRUE; 
     3266                else 
    32583267                        g_warning ("IMAP error getting UIDs (1,1)"); 
    32593268 
     
    32763285                if (!camel_imap_command_start (store, folder, ex, 
    32773286                        "UID SEARCH %d:* ALL", seq + 1 + cnt)) 
    3278                         { if (!camel_operation_cancel_check (NULL)) 
    3279                                 g_warning ("IMAP error getting UIDs (2)"); 
    3280                           camel_operation_end (NULL); 
    3281                           store->dontdistridlehack = FALSE; return; } 
     3287                        { 
     3288                                if (camel_operation_cancel_check (NULL)) 
     3289                                        imap_folder->cancel_occurred = TRUE; 
     3290                                else 
     3291                                        g_warning ("IMAP error getting UIDs (2)"); 
     3292                                camel_operation_end (NULL); 
     3293                                store->dontdistridlehack = FALSE; 
     3294                                return; 
     3295                        } 
    32823296                cnt = imap_get_uids (folder, store, ex, needheaders, (exists - seq) - cnt); 
    32833297 
    32843298                if (cnt == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) 
    32853299                { 
    3286                         if (!camel_operation_cancel_check (NULL)) 
     3300                        if (camel_operation_cancel_check (NULL)) 
     3301                                imap_folder->cancel_occurred = TRUE; 
     3302                        else 
    32873303                                g_warning ("IMAP error getting UIDs (2,1)"); 
    32883304 
     
    33053321                        if (!camel_imap_command_start (store, folder, ex, 
    33063322                                "UID FETCH 1:* (UID)")) /* Old less efficient style */ 
    3307                                 { if (!camel_operation_cancel_check (NULL)) 
    3308                                         g_warning ("IMAP error getting UIDs (3)"); 
     3323                                { 
     3324                                        if (camel_operation_cancel_check (NULL)) 
     3325                                                imap_folder->cancel_occurred = TRUE; 
     3326                                        else 
     3327                                                g_warning ("IMAP error getting UIDs (3)"); 
    33093328                                        camel_folder_summary_kill_hash (folder->summary); 
    3310                                   camel_operation_end (NULL); 
    3311                                   store->dontdistridlehack = FALSE; return; } 
     3329                                        camel_operation_end (NULL); 
     3330                                        store->dontdistridlehack = FALSE; 
     3331                                        return; 
     3332                                } 
    33123333                        camel_folder_summary_clear (folder->summary); 
    33133334                        tcnt = cnt = imap_get_uids (folder, store, ex, needheaders, (exists - seq) - tcnt); 
     
    33153336                        if (cnt == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) 
    33163337                        { 
    3317                                 if (!camel_operation_cancel_check (NULL)) 
     3338                                if (camel_operation_cancel_check (NULL)) 
     3339                                        imap_folder->cancel_occurred = TRUE; 
     3340                                else 
    33183341                                        g_warning ("IMAP error getting UIDs (3,1)"); 
    33193342 
     
    33533376                                                       uidset, header_spec)) 
    33543377                        { 
    3355                                 if (!camel_operation_cancel_check (NULL)) 
     3378                                if (camel_operation_cancel_check (NULL)) 
     3379                                        imap_folder->cancel_occurred = TRUE; 
     3380                                else 
    33563381                                        g_warning ("IMAP error getting headers (1)"); 
    33573382                                g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL); 
     
    34933518                        if (type == CAMEL_IMAP_RESPONSE_ERROR) 
    34943519                        { 
    3495                                 if (!camel_operation_cancel_check (NULL)) 
     3520                                if (camel_operation_cancel_check (NULL)) 
     3521                                        imap_folder->cancel_occurred = TRUE; 
     3522                                else 
    34963523                                        g_warning ("IMAP error getting headers (2)"); 
    34973524                                g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL); 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.h

    r2950 r3406  
    5252        gchar *folder_dir; 
    5353 
    54         gboolean do_push_email, stopping, in_idle
     54        gboolean do_push_email, stopping, in_idle, cancel_occurred
    5555        guint gmsgstore_signal; 
    5656        GStaticRecMutex *idle_lock;