aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@helixcode.com>2000-12-18 14:49:02 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2000-12-18 14:49:02 +0800
commitd89c235bc79ec2263be25144f1b9ed6b3d005821 (patch)
tree9d776b3201c53aa4369d821d52d13d93d52e6255 /mail
parent4f161c2332035d55870adce47aae2cfadef58156 (diff)
downloadgsoc2013-evolution-d89c235bc79ec2263be25144f1b9ed6b3d005821.tar
gsoc2013-evolution-d89c235bc79ec2263be25144f1b9ed6b3d005821.tar.gz
gsoc2013-evolution-d89c235bc79ec2263be25144f1b9ed6b3d005821.tar.bz2
gsoc2013-evolution-d89c235bc79ec2263be25144f1b9ed6b3d005821.tar.lz
gsoc2013-evolution-d89c235bc79ec2263be25144f1b9ed6b3d005821.tar.xz
gsoc2013-evolution-d89c235bc79ec2263be25144f1b9ed6b3d005821.tar.zst
gsoc2013-evolution-d89c235bc79ec2263be25144f1b9ed6b3d005821.zip
Only update display every 2 seconds.
2000-12-18 Miguel de Icaza <miguel@helixcode.com> * mail-tools.c (mail_tool_move_folder_contents): Only update display every 2 seconds. * mail-ops.c (do_view_messages): Only update display every 2 seconds. svn path=/trunk/; revision=7066
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/mail-local.c3
-rw-r--r--mail/mail-ops.c15
-rw-r--r--mail/mail-tools.c17
4 files changed, 35 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index c6db5ef2b2..2227adae95 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2000-12-18 Miguel de Icaza <miguel@helixcode.com>
+
+ * mail-tools.c (mail_tool_move_folder_contents): Only update
+ display every 2 seconds.
+
+ * mail-ops.c (do_view_messages): Only update display every 2 seconds.
+
2000-12-16 Not Zed <NotZed@HelixCode.com>
* message-list.c (build_tree): Always use the slow (full-update)
diff --git a/mail/mail-local.c b/mail/mail-local.c
index dac7cbb2b8..c86518e07a 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -175,7 +175,8 @@ save_metainfo(struct _local_meta *meta)
*/
-static void update_progress(char *fmt, float percent)
+static void
+update_progress(char *fmt, float percent)
{
if (fmt)
mail_op_set_message ("%s", fmt);
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index baa026acb7..5e0e4a56e7 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -2328,16 +2328,25 @@ do_view_messages (gpointer in_data, gpointer op_data, CamelException *ex)
{
view_messages_input_t *input = (view_messages_input_t *) in_data;
view_messages_data_t *data = (view_messages_data_t *) op_data;
-
+ time_t last_update = 0;
int i;
data->messages = g_ptr_array_new ();
for (i = 0; i < input->uids->len; i++) {
CamelMimeMessage *message;
+ const gboolean last_message = (i+1 == input->uids->len);
+ time_t now;
- mail_op_set_message (_("Retrieving message %d of %d (uid \"%s\")"),
- i + 1, input->uids->len, (char *)input->uids->pdata[i]);
+ /*
+ * Update display every 2 seconds
+ */
+ time (&now);
+ if (last_message || ((now - last_update) > 2)) {
+ mail_op_set_message (_("Retrieving message %d of %d (uid \"%s\")"),
+ i + 1, input->uids->len, (char *)input->uids->pdata[i]);
+ last_update = now;
+ }
mail_tool_camel_lock_up ();
message = camel_folder_get_message (input->folder, input->uids->pdata[i], ex);
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index f295967c71..80e9638ce1 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -228,6 +228,7 @@ mail_tool_move_folder_contents (CamelFolder *source, CamelFolder *dest, gboolean
GPtrArray *uids;
int i;
gboolean summary_capability;
+ time_t last_update = 0;
mail_tool_camel_lock_up();
@@ -284,11 +285,21 @@ mail_tool_move_folder_contents (CamelFolder *source, CamelFolder *dest, gboolean
for (i = 0; i < uids->len; i++) {
CamelMimeMessage *msg;
const CamelMessageInfo *info = NULL;
-
+ const gboolean last_message = (i+1 == uids->len);
+ time_t now;
+
/* Info */
- mail_op_set_message (_("Retrieving message %d of %d"),
- i + 1, uids->len);
+ /*
+ * Only update display every 2 seconds, as mail_op_set_message
+ * is an expensive operation
+ */
+ time (&now);
+ if (last_message || ((now - last_update) > 2)) {
+ mail_op_set_message (_("Retrieving message %d of %d"),
+ i + 1, uids->len);
+ last_update = now;
+ }
/* Get the message */