Changeset 3406
- Timestamp:
- 02/15/08 17:33:51
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3400 r3406 1 2008-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 6 2008-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 1 15 2008-02-12 Alberto Garcia Gonzalez <agarcia@igalia.com> 2 16 trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r3386 r3406 248 248 imap_folder->stopping = FALSE; 249 249 imap_folder->in_idle = FALSE; 250 imap_folder->cancel_occurred = FALSE; 250 251 251 252 imap_folder->gmsgstore = NULL; … … 751 752 } 752 753 753 if (imap_folder->need_rescan ) {754 if (imap_folder->need_rescan && !imap_folder->cancel_occurred) { 754 755 suc = imap_rescan (folder, exists, ex); 755 if (imap_folder->need_rescan )756 if (imap_folder->need_rescan && !imap_folder->cancel_occurred) 756 757 camel_imap_folder_changed (folder, exists, NULL, ex); 757 } else if (exists > count )758 } else if (exists > count && !imap_folder->cancel_occurred) 758 759 camel_imap_folder_changed (folder, exists, NULL, ex); 760 761 imap_folder->cancel_occurred = FALSE; 759 762 } else { 760 763 /* Wow, this IMAP server rocks! it has QRESYNC! Hi there Isode!*/ … … 776 779 camel_folder_change_info_free(changes); 777 780 } 778 779 781 } 780 782 … … 3245 3247 if (!camel_imap_command_start (store, folder, ex, 3246 3248 "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 } 3250 3257 3251 3258 more = FALSE; … … 3255 3262 if (cnt == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) 3256 3263 { 3257 if (!camel_operation_cancel_check (NULL)) 3264 if (camel_operation_cancel_check (NULL)) 3265 imap_folder->cancel_occurred = TRUE; 3266 else 3258 3267 g_warning ("IMAP error getting UIDs (1,1)"); 3259 3268 … … 3276 3285 if (!camel_imap_command_start (store, folder, ex, 3277 3286 "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 } 3282 3296 cnt = imap_get_uids (folder, store, ex, needheaders, (exists - seq) - cnt); 3283 3297 3284 3298 if (cnt == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) 3285 3299 { 3286 if (!camel_operation_cancel_check (NULL)) 3300 if (camel_operation_cancel_check (NULL)) 3301 imap_folder->cancel_occurred = TRUE; 3302 else 3287 3303 g_warning ("IMAP error getting UIDs (2,1)"); 3288 3304 … … 3305 3321 if (!camel_imap_command_start (store, folder, ex, 3306 3322 "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)"); 3309 3328 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 } 3312 3333 camel_folder_summary_clear (folder->summary); 3313 3334 tcnt = cnt = imap_get_uids (folder, store, ex, needheaders, (exists - seq) - tcnt); … … 3315 3336 if (cnt == 0 && camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL) 3316 3337 { 3317 if (!camel_operation_cancel_check (NULL)) 3338 if (camel_operation_cancel_check (NULL)) 3339 imap_folder->cancel_occurred = TRUE; 3340 else 3318 3341 g_warning ("IMAP error getting UIDs (3,1)"); 3319 3342 … … 3353 3376 uidset, header_spec)) 3354 3377 { 3355 if (!camel_operation_cancel_check (NULL)) 3378 if (camel_operation_cancel_check (NULL)) 3379 imap_folder->cancel_occurred = TRUE; 3380 else 3356 3381 g_warning ("IMAP error getting headers (1)"); 3357 3382 g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL); … … 3493 3518 if (type == CAMEL_IMAP_RESPONSE_ERROR) 3494 3519 { 3495 if (!camel_operation_cancel_check (NULL)) 3520 if (camel_operation_cancel_check (NULL)) 3521 imap_folder->cancel_occurred = TRUE; 3522 else 3496 3523 g_warning ("IMAP error getting headers (2)"); 3497 3524 g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL); trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.h
r2950 r3406 52 52 gchar *folder_dir; 53 53 54 gboolean do_push_email, stopping, in_idle ;54 gboolean do_push_email, stopping, in_idle, cancel_occurred; 55 55 guint gmsgstore_signal; 56 56 GStaticRecMutex *idle_lock;
