Changeset 3820
- Timestamp:
- 11/20/08 14:20:08
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-operation.c (modified) (4 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-operation.h (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3819 r3820 1 2008-11-20 Martin Bonnin <martinbonnin@gmail.com> 2 3 * camel operation: 4 adding camel_operation_mute/unmute() and use it to filter the progress 5 events. This prevents to send bad progress when refreshing an IMAP folder 6 1 7 2008-11-20 Martin Bonnin <martinbonnin@gmail.com> 2 8 trunk/libtinymail-camel/camel-lite/camel/camel-operation.c
r3423 r3820 44 44 #endif 45 45 #define CAMEL_OPERATION_TRANSIENT (1<<1) 46 #define CAMEL_OPERATION_MUTE (1<<2) 46 47 47 48 /* Delay before a transient operation has any effect on the status */ … … 112 113 } 113 114 115 static void 116 co_mute(CamelOperation *cc, gboolean mute) 117 { 118 struct _status_stack *s; 119 120 if (cc == NULL) 121 cc = co_getcc(); 122 123 if (cc == NULL) 124 return; 125 126 LOCK(); 127 128 if (cc->status == NULL || cc->status_stack == NULL) { 129 UNLOCK(); 130 return; 131 } 132 133 s = cc->status_stack->data; 134 135 if (mute){ 136 s->flags |= CAMEL_OPERATION_MUTE; 137 } else { 138 s->flags &= ~CAMEL_OPERATION_MUTE; 139 } 140 141 UNLOCK(); 142 } 143 144 114 145 /** 115 146 * camel_operation_mute: 116 147 * @cc: 117 148 * 118 * mutes a camel operation permanently.from this point on you will never149 * mutes a camel operation. from this point on you will never 119 150 * receive operation updates, even if more are sent. 120 151 **/ … … 122 153 camel_operation_mute(CamelOperation *cc) 123 154 { 124 LOCK(); 125 cc->status = NULL; 126 cc->status_data = NULL; 127 UNLOCK(); 155 co_mute(cc, TRUE); 156 } 157 158 /** 159 * camel_operation_unmute: 160 * @cc: 161 * 162 * unmutes a camel operation. 163 * Makes the operation send updates again 164 **/ 165 void 166 camel_operation_unmute(CamelOperation *cc) 167 { 168 co_mute(cc, FALSE); 128 169 } 129 170 … … 578 619 579 620 s = cc->status_stack->data; 621 622 if( s->flags & CAMEL_OPERATION_MUTE ){ 623 UNLOCK(); 624 return; 625 } 626 580 627 s->sofar = sofar; 581 628 s->oftotal = oftotal; trunk/libtinymail-camel/camel-lite/camel/camel-operation.h
r3423 r3820 82 82 CamelOperation *camel_operation_new(CamelOperationStatusFunc status, void *status_data); 83 83 void camel_operation_mute(CamelOperation *cc); 84 void camel_operation_unmute(CamelOperation *cc); 84 85 void camel_operation_ref(CamelOperation *cc); 85 86 void camel_operation_unref(CamelOperation *cc); trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
r3819 r3820 3285 3285 3286 3286 camel_operation_start (NULL, _("Fetching summary information for new messages in folder")); 3287 camel_operation_mute (NULL); 3287 3288 3288 3289 camel_folder_summary_prepare_hash (folder->summary); … … 3552 3553 3553 3554 allhdrs++; 3555 3556 camel_operation_unmute (NULL); 3554 3557 camel_operation_progress (NULL, allhdrs , ineed); 3558 camel_operation_mute (NULL); 3559 3555 3560 sequence = GPOINTER_TO_INT (g_datalist_get_data (&data, "SEQUENCE")); 3556 3561 curlen = camel_folder_summary_count (folder->summary);
