aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/pop3/camel-pop3-store.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-02-08 09:42:53 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-02-08 09:42:53 +0800
commit49f8a687a41e635cd83807d33c74afe8e55fb3df (patch)
tree4162f19a2db18ff787386c7c97a98e5e8a5e7744 /camel/providers/pop3/camel-pop3-store.c
parent1290da3f286a31745b1814610c16918c2e84e140 (diff)
downloadgsoc2013-evolution-49f8a687a41e635cd83807d33c74afe8e55fb3df.tar
gsoc2013-evolution-49f8a687a41e635cd83807d33c74afe8e55fb3df.tar.gz
gsoc2013-evolution-49f8a687a41e635cd83807d33c74afe8e55fb3df.tar.bz2
gsoc2013-evolution-49f8a687a41e635cd83807d33c74afe8e55fb3df.tar.lz
gsoc2013-evolution-49f8a687a41e635cd83807d33c74afe8e55fb3df.tar.xz
gsoc2013-evolution-49f8a687a41e635cd83807d33c74afe8e55fb3df.tar.zst
gsoc2013-evolution-49f8a687a41e635cd83807d33c74afe8e55fb3df.zip
Changed to push the operation into a status stack.
2001-02-07 Not Zed <NotZed@Ximian.com> * camel-operation.c (camel_operation_start): Changed to push the operation into a status stack. (camel_operation_progress): Changed to only accept % complete. (camel_operation_reset): Free status stack as well. * providers/pop3/camel-pop3-folder.c (pop3_get_message): Get the octect count from the return line, and pass it to get_additional_data(). (pop3_refresh_info): Added status stuff. * providers/pop3/camel-pop3-store.c (camel_pop3_command_get_additional_data): Added a total bytes expected argument for progress reporting & fixed callers. (camel_pop3_command_get_additional_data): Added progress reporting. * providers/local/camel-mbox-summary.c (mbox_summary_sync_full): (mbox_summary_sync_quick): (summary_rebuild): Added progress reporting stuff. svn path=/trunk/; revision=8095
Diffstat (limited to 'camel/providers/pop3/camel-pop3-store.c')
-rw-r--r--camel/providers/pop3/camel-pop3-store.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index aefabebfa4..f0338a8584 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -35,6 +35,8 @@
#include <unistd.h>
#include <errno.h>
+#include "camel-operation.h"
+
#ifdef HAVE_KRB4
/* Specified nowhere */
#define KPOP_PORT 1109
@@ -250,7 +252,7 @@ connect_to_server (CamelService *service, /*gboolean real, */CamelException *ex)
char *p;
int len;
- buf = camel_pop3_command_get_additional_data (store, ex);
+ buf = camel_pop3_command_get_additional_data (store, 0, ex);
if (camel_exception_is_set (ex))
return FALSE;
@@ -632,6 +634,7 @@ pop3_get_response (CamelPop3Store *store, char **ret, CamelException *ex)
* camel_pop3_command_get_additional_data: get "additional data" from
* a POP3 command.
* @store: the POP3 store
+ * @total: Total bytes expected (for progress reporting), use 0 for 'unknown'.
*
* This command gets the additional data returned by "multi-line" POP
* commands, such as LIST, RETR, TOP, and UIDL. This command _must_
@@ -643,11 +646,12 @@ pop3_get_response (CamelPop3Store *store, char **ret, CamelException *ex)
* Return value: the data, which the caller must free.
**/
char *
-camel_pop3_command_get_additional_data (CamelPop3Store *store, CamelException *ex)
+camel_pop3_command_get_additional_data (CamelPop3Store *store, int total, CamelException *ex)
{
GPtrArray *data;
char *buf, *p;
int i, len = 0, status = CAMEL_POP3_OK;
+ int pc = 0;
data = g_ptr_array_new ();
while (1) {
@@ -661,6 +665,13 @@ camel_pop3_command_get_additional_data (CamelPop3Store *store, CamelException *e
g_ptr_array_add (data, buf);
len += strlen (buf) + 1;
+
+ if (total) {
+ pc = (len+1) * 100 / total;
+ camel_operation_progress(NULL, pc);
+ } else {
+ camel_operation_progress_count(NULL, len);
+ }
}
if (buf)