summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2017-10-27 14:20:18 +0200
committerMilan Crha <mcrha@redhat.com>2017-10-27 14:27:33 +0200
commit2cd88a32bc85b18ea505f16414881151006fb836 (patch)
tree521e1c8e77f42b3ee21c54e5a39951ba8bd73969
parentefe14e5959e6c316fc82bd47213db558a60f1427 (diff)
downloadevolution-data-server-2cd88a32bc85b18ea505f16414881151006fb836.tar.gz
[IMAPx] Show progress of message body download only
Showing progress of message headers download hides the percentage of the local folder summary update.
-rw-r--r--src/camel/providers/imapx/camel-imapx-input-stream.c3
-rw-r--r--src/camel/providers/imapx/camel-imapx-input-stream.h1
-rw-r--r--src/camel/providers/imapx/camel-imapx-utils.c6
3 files changed, 6 insertions, 4 deletions
diff --git a/src/camel/providers/imapx/camel-imapx-input-stream.c b/src/camel/providers/imapx/camel-imapx-input-stream.c
index 4ebf37cce..a757fa067 100644
--- a/src/camel/providers/imapx/camel-imapx-input-stream.c
+++ b/src/camel/providers/imapx/camel-imapx-input-stream.c
@@ -540,6 +540,7 @@ camel_imapx_input_stream_nstring (CamelIMAPXInputStream *is,
gboolean
camel_imapx_input_stream_nstring_bytes (CamelIMAPXInputStream *is,
GBytes **out_bytes,
+ gboolean with_progress,
GCancellable *cancellable,
GError **error)
{
@@ -571,7 +572,7 @@ camel_imapx_input_stream_nstring_bytes (CamelIMAPXInputStream *is,
* automatically use a file backing. */
camel_imapx_input_stream_set_literal (is, len);
output_stream = g_memory_output_stream_new_resizable ();
- if (len > 1024) {
+ if (with_progress && len > 1024) {
bytes_written = imapx_splice_with_progress (output_stream, G_INPUT_STREAM (is),
len, cancellable, error);
if (!g_output_stream_close (output_stream, cancellable, error))
diff --git a/src/camel/providers/imapx/camel-imapx-input-stream.h b/src/camel/providers/imapx/camel-imapx-input-stream.h
index f2a7cc4c4..7d60c5722 100644
--- a/src/camel/providers/imapx/camel-imapx-input-stream.h
+++ b/src/camel/providers/imapx/camel-imapx-input-stream.h
@@ -128,6 +128,7 @@ gboolean camel_imapx_input_stream_nstring
gboolean camel_imapx_input_stream_nstring_bytes
(CamelIMAPXInputStream *is,
GBytes **out_bytes,
+ gboolean with_progress,
GCancellable *cancellable,
GError **error);
/* gets 'text' */
diff --git a/src/camel/providers/imapx/camel-imapx-utils.c b/src/camel/providers/imapx/camel-imapx-utils.c
index 82648eda2..478bf5320 100644
--- a/src/camel/providers/imapx/camel-imapx-utils.c
+++ b/src/camel/providers/imapx/camel-imapx-utils.c
@@ -1814,7 +1814,7 @@ imapx_parse_fetch_body (CamelIMAPXInputStream *stream,
}
success = camel_imapx_input_stream_nstring_bytes (
- stream, &finfo->body, cancellable, error);
+ stream, &finfo->body, TRUE, cancellable, error);
/* Sanity check. */
g_return_val_if_fail (
@@ -1925,7 +1925,7 @@ imapx_parse_fetch_rfc822_header (CamelIMAPXInputStream *stream,
gboolean success;
success = camel_imapx_input_stream_nstring_bytes (
- stream, &finfo->header, cancellable, error);
+ stream, &finfo->header, FALSE, cancellable, error);
/* Sanity check. */
g_return_val_if_fail (
@@ -1968,7 +1968,7 @@ imapx_parse_fetch_rfc822_text (CamelIMAPXInputStream *stream,
gboolean success;
success = camel_imapx_input_stream_nstring_bytes (
- stream, &finfo->text, cancellable, error);
+ stream, &finfo->text, FALSE, cancellable, error);
/* Sanity check. */
g_return_val_if_fail (