diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-06-17 10:08:16 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-06-17 10:08:16 +0800 |
commit | 4318f82f0381150d57789dc9b707bf0ca448f0b3 (patch) | |
tree | facb5d530a38216d07e306b267756a5e88d0ee2b /camel | |
parent | ccc9fd091a05bb58594caed0555a0b0db10086ad (diff) | |
download | gsoc2013-evolution-4318f82f0381150d57789dc9b707bf0ca448f0b3.tar.gz gsoc2013-evolution-4318f82f0381150d57789dc9b707bf0ca448f0b3.tar.zst gsoc2013-evolution-4318f82f0381150d57789dc9b707bf0ca448f0b3.zip |
Added a 'first' member to the imap_fetch_all_t struct so we can use that
2004-06-16 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap4/camel-imap4-summary.c: Added a 'first' member to
the imap_fetch_all_t struct so we can use that as a base offset in
our GPtrArray, allowing us to limit resource consumption which
could otherwise get quite large. Also added a ChangeInfo member
that was needed for changes to untagged_fetch_all().
(imap4_fetch_all_add): Use fetch->first as a base offset and
change int i to guint32 i. Also updated to sue the fetch->changes.
(imap4_fetch_all_update): Same.
(untagged_fetch_all): Same - this is where it is really valuable,
since we can avoid adding elements to the GPtrArray that we won't
even use. Also needed to change code a big in case index <
fetch->first (which could happen if a server notified us of a
FLAGS change for a message we didn't request info about).
(imap4_fetch_all_free): Free the ChangeInfo.
(imap4_summary_fetch_all): Init fetch->changes and fetch->first.
(imap4_summary_fetch_flags): Same.
(camel_imap4_summary_flush_updates): Only request envelope info if
first <= summary->exists. Avoids needless queries.
(info_uid_sort): #if 0'd
(camel_imap4_summary_flush_updates): No need to sort the summary -
this should never have been needed. I can't remember why I did
this...
svn path=/trunk/; revision=26371
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 10 | ||||
-rw-r--r-- | camel/providers/imap4/camel-imap4-summary.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index ec442955d6..bad3959169 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -5,8 +5,8 @@ our GPtrArray, allowing us to limit resource consumption which could otherwise get quite large. Also added a ChangeInfo member that was needed for changes to untagged_fetch_all(). - (imap4_fetch_all_add): Use fetch->first as a base offset and change - int i to guint32 i. Also updated to sue the fetch->changes. + (imap4_fetch_all_add): Use fetch->first as a base offset and + change int i to guint32 i. Also updated to sue the fetch->changes. (imap4_fetch_all_update): Same. (untagged_fetch_all): Same - this is where it is really valuable, since we can avoid adding elements to the GPtrArray that we won't @@ -16,6 +16,12 @@ (imap4_fetch_all_free): Free the ChangeInfo. (imap4_summary_fetch_all): Init fetch->changes and fetch->first. (imap4_summary_fetch_flags): Same. + (camel_imap4_summary_flush_updates): Only request envelope info if + first <= summary->exists. Avoids needless queries. + (info_uid_sort): #if 0'd + (camel_imap4_summary_flush_updates): No need to sort the summary - + this should never have been needed. I can't remember why I did + this... 2004-06-15 Jeffrey Stedfast <fejj@ximian.com> diff --git a/camel/providers/imap4/camel-imap4-summary.c b/camel/providers/imap4/camel-imap4-summary.c index a91b20dbbc..af53bcef4f 100644 --- a/camel/providers/imap4/camel-imap4-summary.c +++ b/camel/providers/imap4/camel-imap4-summary.c @@ -1163,7 +1163,7 @@ camel_imap4_summary_expunge (CamelFolderSummary *summary, int seqid) camel_folder_change_info_free (changes); } - +#if 0 static int info_uid_sort (const CamelMessageInfo **info0, const CamelMessageInfo **info1) { @@ -1177,6 +1177,7 @@ info_uid_sort (const CamelMessageInfo **info0, const CamelMessageInfo **info1) return uid0 < uid1 ? -1 : 1; } +#endif int camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException *ex) @@ -1218,7 +1219,7 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * first = scount + 1; } - if (first != 0 && imap4_summary->exists > 0) { + if (first != 0 && first <= imap4_summary->exists) { ic = imap4_summary_fetch_all (summary, first, 0); while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1) @@ -1234,8 +1235,13 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * imap4_fetch_all_add (ic->user_data); camel_imap4_command_unref (ic); +#if 0 + /* Note: this should not be needed - the code that adds envelopes to the summary + * adds them in proper order */ + /* it's important for these to be sorted sequentially for EXPUNGE events to work */ g_ptr_array_sort (summary->messages, (GCompareFunc) info_uid_sort); +#endif } imap4_summary->update_flags = FALSE; |