diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-08-07 03:24:04 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-08-07 03:24:04 +0800 |
commit | d1ed7c7084f3b1e139f6de0b590cba67014645ce (patch) | |
tree | 8b1f70481e74dfc8b32cf2ae1553073d8addf248 | |
parent | 942f907d50ecd22950d9505397c48533cc8fba82 (diff) | |
download | gsoc2013-evolution-d1ed7c7084f3b1e139f6de0b590cba67014645ce.tar gsoc2013-evolution-d1ed7c7084f3b1e139f6de0b590cba67014645ce.tar.gz gsoc2013-evolution-d1ed7c7084f3b1e139f6de0b590cba67014645ce.tar.bz2 gsoc2013-evolution-d1ed7c7084f3b1e139f6de0b590cba67014645ce.tar.lz gsoc2013-evolution-d1ed7c7084f3b1e139f6de0b590cba67014645ce.tar.xz gsoc2013-evolution-d1ed7c7084f3b1e139f6de0b590cba67014645ce.tar.zst gsoc2013-evolution-d1ed7c7084f3b1e139f6de0b590cba67014645ce.zip |
Call camel_operation_progress(). (imap4_summary_fetch_all): Setup info we
2004-08-06 Jeffrey Stedfast <fejj@novell.com>
* providers/imap4/camel-imap4-summary.c (untagged_fetch_all): Call
camel_operation_progress().
(imap4_summary_fetch_all): Setup info we need for progress
reporting.
(imap4_summary_fetch_flags): Same.
svn path=/trunk/; revision=26846
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/providers/imap4/camel-imap4-summary.c | 21 |
2 files changed, 29 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 4a9c83f055..aa2ed7dff6 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2004-08-06 Jeffrey Stedfast <fejj@novell.com> + + * providers/imap4/camel-imap4-summary.c (untagged_fetch_all): Call + camel_operation_progress(). + (imap4_summary_fetch_all): Setup info we need for progress + reporting. + (imap4_summary_fetch_flags): Same. + 2004-08-04 Rodney Dawes <dobey@novell.com> * camel-charset-map.c: #include <gal/util/e-iconv.h> diff --git a/camel/providers/imap4/camel-imap4-summary.c b/camel/providers/imap4/camel-imap4-summary.c index af53bcef4f..ed4a9cbde9 100644 --- a/camel/providers/imap4/camel-imap4-summary.c +++ b/camel/providers/imap4/camel-imap4-summary.c @@ -598,6 +598,9 @@ struct imap4_fetch_all_t { GHashTable *uid_hash; GPtrArray *added; guint32 first; + guint32 need; + int count; + int total; }; static void @@ -891,6 +894,8 @@ untagged_fetch_all (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 ind if (envelope) { envelope->changed |= changed; + if ((envelope->changed & fetch->need) == fetch->need) + camel_operation_progress (NULL, (++fetch->count * 100.0f) / fetch->total); } else if (changed & IMAP4_FETCH_FLAGS) { camel_folder_change_info_change_uid (fetch->changes, camel_message_info_uid (info)); } @@ -930,6 +935,11 @@ imap4_summary_fetch_all (CamelFolderSummary *summary, guint32 first, guint32 las fetch->added = g_ptr_array_new (); fetch->summary = summary; fetch->first = first; + fetch->need = IMAP4_FETCH_ALL; + fetch->total = last ? (last - first) + 1 : (imap4_summary->exists - first) + 1; + fetch->count = 0; + + g_ptr_array_set_size (fetch->added, fetch->total); /* From rfc2060, Section 6.4.5: * @@ -971,6 +981,11 @@ imap4_summary_fetch_flags (CamelFolderSummary *summary, guint32 first, guint32 l fetch->added = g_ptr_array_new (); fetch->summary = summary; fetch->first = first; + fetch->need = IMAP4_FETCH_UID | IMAP4_FETCH_FLAGS; + fetch->total = (last - first) + 1; + fetch->count = 0; + + g_ptr_array_set_size (fetch->added, fetch->total); if (last != 0) ic = camel_imap4_engine_queue (engine, folder, "FETCH %u:%u (UID FLAGS)\r\n", first, last); @@ -1201,6 +1216,7 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * * client */ ic = imap4_summary_fetch_flags (summary, 1, scount); + camel_operation_start (NULL, _("Scanning for changed messages")); while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1) ; @@ -1208,6 +1224,7 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * imap4_fetch_all_free (ic->user_data); camel_exception_xfer (ex, &ic->ex); camel_imap4_command_unref (ic); + camel_operation_end (NULL); return -1; } @@ -1215,6 +1232,7 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * first = scount + 1; camel_imap4_command_unref (ic); + camel_operation_end (NULL); } else { first = scount + 1; } @@ -1222,6 +1240,7 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * if (first != 0 && first <= imap4_summary->exists) { ic = imap4_summary_fetch_all (summary, first, 0); + camel_operation_start (NULL, _("Fetching envelopes for new messages")); while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1) ; @@ -1229,11 +1248,13 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * imap4_fetch_all_free (ic->user_data); camel_exception_xfer (ex, &ic->ex); camel_imap4_command_unref (ic); + camel_operation_end (NULL); return -1; } imap4_fetch_all_add (ic->user_data); camel_imap4_command_unref (ic); + camel_operation_end (NULL); #if 0 /* Note: this should not be needed - the code that adds envelopes to the summary |