diff options
author | Miguel de Icaza <miguel@helixcode.com> | 2000-10-08 14:39:20 +0800 |
---|---|---|
committer | Miguel de Icaza <miguel@src.gnome.org> | 2000-10-08 14:39:20 +0800 |
commit | c627461cec1e4199e8a572f60ca265d25c0cf4fc (patch) | |
tree | b920fb62a51cd9264f29a891ecff2e6ef84d15ac /mail/mail-ops.c | |
parent | f3b80606d8cca689cce2584083bb6bc9e9a0b618 (diff) | |
download | gsoc2013-evolution-c627461cec1e4199e8a572f60ca265d25c0cf4fc.tar.gz gsoc2013-evolution-c627461cec1e4199e8a572f60ca265d25c0cf4fc.tar.zst gsoc2013-evolution-c627461cec1e4199e8a572f60ca265d25c0cf4fc.zip |
Repeates writes on EINTRS. (pipe_read): Repeats reads on EINTRS.
2000-10-08 Miguel de Icaza <miguel@helixcode.com>
* mail-threads.c (pipe_write): Repeates writes on EINTRS.
(pipe_read): Repeats reads on EINTRS.
(mail_operation_queue): Use pipe_write
(mail_op_set_percentage): ditto.
(mail_op_hide_progressbar): ditto.
(mail_op_show_progressbar): ditto.
(mail_op_set_message): ditto.
(mail_op_get_password): ditto.
(mail_op_error): ditto.
(mail_op_forward_event): ditto.
(mail_operations_terminate): ditto.
(dispatch): use pipe_read.
(dispatch): use pipe_write
(dispatch): ditto.
* mail-ops.c (mail_incorporate_messages): Only show message being
incorporated every 2 seconds, to avoid a bunch of CORBA round trips.
(do_transfer_messages): ditto.
(do_forward_messages): ditto.
svn path=/trunk/; revision=5783
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 61 |
1 files changed, 51 insertions, 10 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 9bca75bb13..e4d7314ea9 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -111,7 +111,8 @@ mail_incorporate_messages (CamelFolder *folder, char *url, *p, *filename; FILE *logfile; int i; - + time_t last_update = 0; + fc = mail_load_evolution_rule_context (); filter = filter_driver_new (fc, mail_tool_filter_get_folder_func, 0); @@ -159,8 +160,17 @@ mail_incorporate_messages (CamelFolder *folder, CamelMimeMessage *message; CamelMessageInfo *info; gboolean free_info; - - mail_op_set_message ("Retrieving message %d of %d", i + 1, uids->len); + gboolean last_message = (i+1 == uids->len); + time_t now; + + /* + * Update the time display ever 2 seconds + */ + 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; + } message = camel_folder_get_message (folder, uids->pdata[i], ex); if (camel_exception_is_set (ex)) @@ -964,6 +974,7 @@ do_transfer_messages (gpointer in_data, gpointer op_data, CamelException *ex) transfer_messages_input_t *input = (transfer_messages_input_t *) in_data; CamelFolder *dest; gint i; + time_t last_update = 0; gchar *desc; void (*func) (CamelFolder *, const char *, CamelFolder *, @@ -986,9 +997,19 @@ do_transfer_messages (gpointer in_data, gpointer op_data, CamelException *ex) camel_folder_freeze (dest); for (i = 0; i < input->uids->len; i++) { - mail_op_set_message (_("%s message %d of %d (uid \"%s\")"), desc, - i + 1, input->uids->len, (char *) input->uids->pdata[i]); + const gboolean last_message = (i+1 == input->uids->len); + time_t now; + /* + * Update the time display ever 2 seconds + */ + time (&now); + if (last_message || ((now - last_update) > 2)){ + mail_op_set_message (_("%s message %d of %d (uid \"%s\")"), desc, + i + 1, input->uids->len, (char *) input->uids->pdata[i]); + last_update = now; + } + (func) (input->source, input->uids->pdata[i], dest, ex); @@ -1083,6 +1104,7 @@ do_flag_messages (gpointer in_data, gpointer op_data, CamelException *ex) { flag_messages_input_t *input = (flag_messages_input_t *) in_data; gint i; + time_t last_update = 0; mail_tool_camel_lock_up (); camel_folder_freeze (input->source); @@ -1091,8 +1113,15 @@ do_flag_messages (gpointer in_data, gpointer op_data, CamelException *ex) mail_tool_camel_lock_down (); for (i = 0; i < input->uids->len; i++) { - mail_op_set_message ("Marking message %d of %d", i + 1, - input->uids->len); + const gboolean last_message = (i+1 == input->uids->len); + time_t now; + + time (&now); + if (last_message || ((now - last_update) > 2)){ + mail_op_set_message ("Marking message %d of %d", i + 1, + input->uids->len); + last_update = now; + } if (input->invert) { const CamelMessageInfo *info; @@ -1480,7 +1509,7 @@ do_forward_messages (gpointer in_data, gpointer op_data, CamelException *ex) { forward_messages_input_t *input = (forward_messages_input_t *) in_data; forward_messages_data_t *data = (forward_messages_data_t *) op_data; - + time_t last_update = 0; CamelMimeMessage *message; CamelMimePart *part; int i; @@ -1489,8 +1518,20 @@ do_forward_messages (gpointer in_data, gpointer op_data, CamelException *ex) mail_tool_camel_lock_up (); for (i = 0; i < input->uids->len; i++) { - mail_op_set_message (_("Retrieving message number %d of %d (uid \"%s\")"), - i + 1, input->uids->len, (char *) input->uids->pdata[i]); + const int last_message = (i+1 == input->uids->len); + time_t now; + + /* + * Update the time display ever 2 seconds + */ + time (&now); + if (last_message || ((now - last_update) > 2)){ + mail_op_set_message (_("Retrieving message number %d of %d (uid \"%s\")"), + i + 1, input->uids->len, (char *) input->uids->pdata[i]); + last_update = now; + } + + message = camel_folder_get_message (input->source, input->uids->pdata[i], ex); |