From 794da792b828a620bd234f382de7aa22b90447f2 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 12 Jun 2004 14:25:30 +0000 Subject: Don't bother with exists_changed. We don't need it afterall. 2004-06-12 Jeffrey Stedfast * providers/imap4/camel-imap4-summary.c (camel_imap4_summary_set_exists): Don't bother with exists_changed. We don't need it afterall. (camel_imap4_summary_flush_updates): Instead of updating flags if update_flags or exists_changed is set, only bother if update_flags is set or if exists is smaller than the summary count (since updating flags is also sueful for determining which messages have been removed). svn path=/trunk/; revision=26322 --- camel/ChangeLog | 11 +++++++++++ camel/providers/imap4/camel-imap4-summary.c | 12 ++++-------- camel/providers/imap4/camel-imap4-summary.h | 1 - 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 574223f3b3..a8d7400850 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,14 @@ +2004-06-12 Jeffrey Stedfast + + * providers/imap4/camel-imap4-summary.c + (camel_imap4_summary_set_exists): Don't bother with + exists_changed. We don't need it afterall. + (camel_imap4_summary_flush_updates): Instead of updating flags if + update_flags or exists_changed is set, only bother if update_flags + is set or if exists is smaller than the summary count (since + updating flags is also sueful for determining which messages have + been removed). + 2004-06-11 Jeffrey Stedfast * providers/imap4/camel-imap4-folder.c (imap4_refresh_info): Force diff --git a/camel/providers/imap4/camel-imap4-summary.c b/camel/providers/imap4/camel-imap4-summary.c index f5fec4d05e..ef08974572 100644 --- a/camel/providers/imap4/camel-imap4-summary.c +++ b/camel/providers/imap4/camel-imap4-summary.c @@ -107,7 +107,6 @@ camel_imap4_summary_init (CamelIMAP4Summary *summary, CamelIMAP4SummaryClass *kl folder_summary->message_info_size = sizeof (CamelIMAP4MessageInfo); summary->update_flags = TRUE; - summary->exists_changed = FALSE; summary->uidvalidity_changed = FALSE; } @@ -1010,11 +1009,7 @@ camel_imap4_summary_set_exists (CamelFolderSummary *summary, guint32 exists) g_return_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary)); - if (imap4_summary->exists == exists) - return; - imap4_summary->exists = exists; - imap4_summary->exists_changed = TRUE; } void @@ -1131,14 +1126,14 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * g_return_val_if_fail (CAMEL_IS_IMAP4_SUMMARY (summary), -1); engine = ((CamelIMAP4Store *) imap4_summary->folder->parent_store)->engine; + scount = camel_folder_summary_count (summary); if (imap4_summary->uidvalidity_changed) { first = 1; - } else if (imap4_summary->update_flags || imap4_summary->exists_changed) { + } else if (imap4_summary->update_flags || imap4_summary->exists < scount) { /* this both updates flags and removes messages which * have since been expunged from the server by another * client */ - scount = camel_folder_summary_count (summary); ic = imap4_summary_fetch_flags (summary, 1, scount); while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1) @@ -1155,6 +1150,8 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * first = scount + 1; camel_imap4_command_unref (ic); + } else { + first = scount; } if (first != 0 && imap4_summary->exists > 0) { @@ -1178,7 +1175,6 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * } imap4_summary->update_flags = FALSE; - imap4_summary->exists_changed = FALSE; imap4_summary->uidvalidity_changed = FALSE; return 0; diff --git a/camel/providers/imap4/camel-imap4-summary.h b/camel/providers/imap4/camel-imap4-summary.h index 3bad898a6a..23218ff804 100644 --- a/camel/providers/imap4/camel-imap4-summary.h +++ b/camel/providers/imap4/camel-imap4-summary.h @@ -60,7 +60,6 @@ struct _CamelIMAP4Summary { guint32 uidvalidity; guint uidvalidity_changed:1; - guint exists_changed:1; guint update_flags:1; }; -- cgit