aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-10-20 08:49:11 +0800
committerDan Winship <danw@src.gnome.org>2000-10-20 08:49:11 +0800
commitbbc7b8866aea373f5b46cc7a5e6e7c74789d4c24 (patch)
tree6901adf71f0bdd988f377677e3f8fda58eff79c4 /camel
parentb274ab5c91aab08729c6b504ee7cd10631e3a42d (diff)
downloadgsoc2013-evolution-bbc7b8866aea373f5b46cc7a5e6e7c74789d4c24.tar
gsoc2013-evolution-bbc7b8866aea373f5b46cc7a5e6e7c74789d4c24.tar.gz
gsoc2013-evolution-bbc7b8866aea373f5b46cc7a5e6e7c74789d4c24.tar.bz2
gsoc2013-evolution-bbc7b8866aea373f5b46cc7a5e6e7c74789d4c24.tar.lz
gsoc2013-evolution-bbc7b8866aea373f5b46cc7a5e6e7c74789d4c24.tar.xz
gsoc2013-evolution-bbc7b8866aea373f5b46cc7a5e6e7c74789d4c24.tar.zst
gsoc2013-evolution-bbc7b8866aea373f5b46cc7a5e6e7c74789d4c24.zip
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
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/providers/imap/camel-imap-folder.c22
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,5 +1,10 @@
2000-10-19 Dan Winship <danw@helixcode.com>
+ * providers/imap/camel-imap-folder.c (imap_refresh_info): Emit
+ message_changed and folder_changed as appropriate.
+
+2000-10-19 Dan Winship <danw@helixcode.com>
+
* camel-folder.c (camel_folder_refresh_info): Update comment here
so refresh_info isn't just for reconnects any more. Make the
default implementation a no-op rather than an error.
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