From b4c31f5153efd4a7aa58bd1ebd3319297e528f42 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 18 Sep 2001 20:03:10 +0000 Subject: 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 --- camel/camel-medium.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'camel/camel-medium.c') diff --git a/camel/camel-medium.c b/camel/camel-medium.c index 818df69493..95480754a0 100644 --- a/camel/camel-medium.c +++ b/camel/camel-medium.c @@ -40,6 +40,7 @@ static CamelDataWrapperClass *parent_class = NULL; /* Returns the class for a CamelMedium */ #define CM_CLASS(so) CAMEL_MEDIUM_CLASS (CAMEL_OBJECT_GET_CLASS(so)) +static gboolean is_offline (CamelDataWrapper *data_wrapper); static void add_header (CamelMedium *medium, const gchar *header_name, const void *header_value); static void set_header (CamelMedium *medium, const gchar *header_name, const void *header_value); @@ -56,13 +57,14 @@ static void set_content_object (CamelMedium *medium, static void camel_medium_class_init (CamelMediumClass *camel_medium_class) { - /* - * CamelDataWrapperClass *camel_data_wrapper_class = - * CAMEL_DATA_WRAPPER_CLASS (camel_medium_class); - */ + CamelDataWrapperClass *camel_data_wrapper_class = + CAMEL_DATA_WRAPPER_CLASS (camel_medium_class); parent_class = CAMEL_DATA_WRAPPER_CLASS (camel_type_get_global_classfuncs (camel_data_wrapper_get_type ())); + /* virtual method overload */ + camel_data_wrapper_class->is_offline = is_offline; + /* virtual method definition */ camel_medium_class->add_header = add_header; camel_medium_class->set_header = set_header; @@ -112,6 +114,13 @@ camel_medium_get_type (void) return camel_medium_type; } +static gboolean +is_offline (CamelDataWrapper *data_wrapper) +{ + return parent_class->is_offline (data_wrapper) || + camel_data_wrapper_is_offline (CAMEL_MEDIUM (data_wrapper)->content); +} + static void add_header (CamelMedium *medium, const gchar *header_name, const void *header_value) -- cgit