From bbc7b8866aea373f5b46cc7a5e6e7c74789d4c24 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 20 Oct 2000 00:49:11 +0000 Subject: Emit message_changed and folder_changed as appropriate. * providers/imap/camel-imap-folder.c (imap_refresh_info): Emit message_changed and folder_changed as appropriate. svn path=/trunk/; revision=6064 --- camel/ChangeLog | 5 +++++ camel/providers/imap/camel-imap-folder.c | 22 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index ddf99cac76..380bd9aef6 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,8 @@ +2000-10-19 Dan Winship + + * providers/imap/camel-imap-folder.c (imap_refresh_info): Emit + message_changed and folder_changed as appropriate. + 2000-10-19 Dan Winship * camel-folder.c (camel_folder_refresh_info): Update comment here diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index cd9e374bc6..0a4189372a 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -251,9 +251,14 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex) char *resp, *uid, *p, *flags; int i, seq, summary_len; CamelMessageInfo *info; + gboolean folder_changed = FALSE; if (imap_folder->exists == 0) { - camel_folder_summary_clear (imap_folder->summary); + if (camel_folder_summary_count != 0) { + camel_folder_summary_clear (imap_folder->summary); + camel_object_trigger_event (CAMEL_OBJECT (folder), + "folder_changed", NULL); + } return; } @@ -301,13 +306,19 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex) if (strcmp (info->uid, new[i].uid) != 0) { camel_folder_summary_remove (imap_folder->summary, info); + folder_changed = TRUE; i--; summary_len--; continue; } /* Update summary flags */ - info->flags = new[i].flags; + if (info->flags != new[i].flags) { + info->flags = new[i].flags; + camel_object_trigger_event (CAMEL_OBJECT (folder), + "message_changed", + info->uid); + } g_free (new[i].uid); } @@ -316,17 +327,24 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex) while (summary_len > i + 1) { camel_folder_summary_remove_index (imap_folder->summary, --summary_len); + folder_changed = TRUE; } /* Add any new folder messages. */ if (i < imap_folder->exists) { /* Fetch full summary for the remaining messages. */ imap_update_summary (folder, i + 1, imap_folder->exists, ex); + folder_changed = TRUE; while (i < imap_folder->exists) g_free (new[i++].uid); } g_free (new); + + if (folder_changed) { + camel_object_trigger_event (CAMEL_OBJECT (folder), + "folder_changed", NULL); + } } static void -- cgit v1.2.3