diff options
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/em-subscribe-editor.c | 16 |
2 files changed, 20 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 1d1bc0f896..8ea9c62be9 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2004-09-24 Not Zed <NotZed@Ximian.com> + + ** See bug #66706. + + * em-subscribe-editor.c: add a sequence number to EMSubscribe and + the subscribe_msg structures. NOOP if the sequence has changed in + all callbacks. up the sequence number when we refresh. + 2004-09-20 Not Zed <NotZed@Ximian.com> ** See bug #65329. diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index 08954e9c8c..e3958076af 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -86,6 +86,7 @@ struct _EMSubscribe { int ref_count; int cancel; + int seq; /* upped every time we refresh */ struct _EMSubscribeEditor *editor; /* parent object*/ @@ -327,6 +328,8 @@ sub_fill_level(EMSubscribe *sub, CamelFolderInfo *info, GtkTreeIter *parent, in struct _emse_folderinfo_msg { struct _mail_msg msg; + int seq; + EMSubscribe *sub; EMSubscribeNode *node; CamelFolderInfo *info; @@ -337,9 +340,11 @@ sub_folderinfo_get (struct _mail_msg *mm) { struct _emse_folderinfo_msg *m = (struct _emse_folderinfo_msg *) mm; - camel_operation_register(mm->cancel); - m->info = camel_store_get_folder_info (m->sub->store, m->node?m->node->info->full_name:"", CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, &mm->ex); - camel_operation_unregister(mm->cancel); + if (m->seq == m->sub->seq) { + camel_operation_register(mm->cancel); + m->info = camel_store_get_folder_info(m->sub->store, m->node?m->node->info->full_name:"", CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, &mm->ex); + camel_operation_unregister(mm->cancel); + } } static void @@ -349,7 +354,7 @@ sub_folderinfo_got(struct _mail_msg *mm) EMSubscribeNode *node; m->sub->pending_id = -1; - if (m->sub->cancel) + if (m->sub->cancel || m->seq != m->sub->seq) return; if (camel_exception_is_set (&mm->ex)) { @@ -407,6 +412,7 @@ sub_queue_fill_level(EMSubscribe *sub, EMSubscribeNode *node) sub_ref(sub); m->sub = sub; m->node = node; + m->seq = sub->seq; sub->pending_id = m->msg.seq; @@ -684,6 +690,8 @@ sub_editor_refresh(GtkWidget *w, EMSubscribeEditor *se) if (sub == NULL || sub->store == NULL) return; + sub->seq++; + /* drop any currently pending */ if (sub->pending_id != -1) mail_msg_cancel(sub->pending_id); |