aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-multipart.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-09-19 04:03:10 +0800
committerDan Winship <danw@src.gnome.org>2001-09-19 04:03:10 +0800
commitb4c31f5153efd4a7aa58bd1ebd3319297e528f42 (patch)
treeb1a3f33fab0a8ed4a278107b5267239ff6533298 /camel/camel-multipart.c
parentbb51b55bcc64b0342db45e389342b129a20b8a2a (diff)
downloadgsoc2013-evolution-b4c31f5153efd4a7aa58bd1ebd3319297e528f42.tar
gsoc2013-evolution-b4c31f5153efd4a7aa58bd1ebd3319297e528f42.tar.gz
gsoc2013-evolution-b4c31f5153efd4a7aa58bd1ebd3319297e528f42.tar.bz2
gsoc2013-evolution-b4c31f5153efd4a7aa58bd1ebd3319297e528f42.tar.lz
gsoc2013-evolution-b4c31f5153efd4a7aa58bd1ebd3319297e528f42.tar.xz
gsoc2013-evolution-b4c31f5153efd4a7aa58bd1ebd3319297e528f42.tar.zst
gsoc2013-evolution-b4c31f5153efd4a7aa58bd1ebd3319297e528f42.zip
Virtualize this.
* camel-data-wrapper.c (camel_data_wrapper_is_offline): Virtualize this. * camel-medium.c (is_offline): A medium is offline if its content object is offline. * camel-multipart.c (is_offline): A multipart is offline if any of its subparts are offline. svn path=/trunk/; revision=12948
Diffstat (limited to 'camel/camel-multipart.c')
-rw-r--r--camel/camel-multipart.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/camel/camel-multipart.c b/camel/camel-multipart.c
index 836297a1c8..076ec3af76 100644
--- a/camel/camel-multipart.c
+++ b/camel/camel-multipart.c
@@ -44,6 +44,7 @@
#define d(x)
+static gboolean is_offline (CamelDataWrapper *data_wrapper);
static void add_part (CamelMultipart *multipart,
CamelMimePart *part);
static void add_part_at (CamelMultipart *multipart,
@@ -94,6 +95,7 @@ camel_multipart_class_init (CamelMultipartClass *camel_multipart_class)
/* virtual method overload */
camel_data_wrapper_class->write_to_stream = write_to_stream;
+ camel_data_wrapper_class->is_offline = is_offline;
}
static void
@@ -414,6 +416,24 @@ camel_multipart_get_boundary (CamelMultipart *multipart)
return CMP_CLASS (multipart)->get_boundary (multipart);
}
+static gboolean
+is_offline (CamelDataWrapper *data_wrapper)
+{
+ CamelMultipart *multipart = CAMEL_MULTIPART (data_wrapper);
+ GList *node;
+ CamelDataWrapper *part;
+
+ if (parent_class->is_offline (data_wrapper))
+ return TRUE;
+ for (node = multipart->parts; node; node = node->next) {
+ part = node->data;
+ if (camel_data_wrapper_is_offline (part))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/* this is MIME specific, doesn't belong here really */
static int
write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)