* src/widgets/modest-attachment-view.c:
authorJose Dapena Paz <jdapena@igalia.com>
Fri, 6 Jul 2007 14:43:49 +0000 (14:43 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Fri, 6 Jul 2007 14:43:49 +0000 (14:43 +0000)
        * Count the decoded attachment size instead of the encoded size.
          This should make the size be the expected one (fixes NB#61088).

pmo-trunk-r2614

src/widgets/modest-attachment-view.c

index 6eebfe6..c2ea039 100644 (file)
@@ -38,6 +38,7 @@
 #include <modest-platform.h>
 #include <modest-text-utils.h>
 #include <tny-msg.h>
+#include <tny-camel-mem-stream.h>
 
 static GObjectClass *parent_class = NULL;
 
@@ -136,7 +137,9 @@ get_size_idle_func (gpointer data)
        gchar *size_string;
 
        if (priv->get_size_stream == NULL) {
-               priv->get_size_stream = tny_mime_part_get_stream (priv->mime_part);
+               priv->get_size_stream = tny_camel_mem_stream_new ();
+               tny_mime_part_decode_to_stream (priv->mime_part, priv->get_size_stream);
+               tny_stream_reset (priv->get_size_stream);
        }
 
        readed_size = tny_stream_read (priv->get_size_stream, read_buffer, GET_SIZE_BUFFER_SIZE);