[evolution-data-server/gnome-3-26] [IMAPx] Show progress of message body download only
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-26] [IMAPx] Show progress of message body download only
- Date: Fri, 27 Oct 2017 12:31:08 +0000 (UTC)
commit 2cd88a32bc85b18ea505f16414881151006fb836
Author: Milan Crha <mcrha redhat com>
Date: Fri Oct 27 14:20:18 2017 +0200
[IMAPx] Show progress of message body download only
Showing progress of message headers download hides the percentage
of the local folder summary update.
.../providers/imapx/camel-imapx-input-stream.c | 3 ++-
.../providers/imapx/camel-imapx-input-stream.h | 1 +
src/camel/providers/imapx/camel-imapx-utils.c | 6 +++---
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 4ebf37c..a757fa0 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 f2a7cc4..7d60c57 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 82648ed..478bf53 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 (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]