aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
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/mail-tools.c
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/mail-tools.c')
-rw-r--r--mail/mail-tools.c17
1 files changed, 14 insertions, 3 deletions
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 */