aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2007-10-05 13:45:28 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-10-05 13:45:28 +0800
commite188aba01b54c93555963969f008a04c3ca3fa0b (patch)
tree2abe68ebe0b9ea8de0369fc34366aa003ef194d4 /mail
parentc44d7bdc7305613757ea5b2a2b3187face5500cb (diff)
downloadgsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.tar
gsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.tar.gz
gsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.tar.bz2
gsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.tar.lz
gsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.tar.xz
gsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.tar.zst
gsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.zip
** Fix for bug #468736
svn path=/trunk/; revision=34355
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/em-folder-view.c3
-rw-r--r--mail/em-format.c32
-rw-r--r--mail/em-format.h1
4 files changed, 44 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 98b078f75c..22f373fb35 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2007-10-05 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #468736
+
+ * em-folder-view.c: (em_folder_view_print):
+ * em-format.c: (merge_missing), (em_format_merge_handler):
+ * em-format.h:
+
2007-10-04 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #477045
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index 200422848a..b7d80bac03 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -2197,6 +2197,9 @@ em_folder_view_print (EMFolderView *emfv, GtkPrintOperationAction action)
em_format_set_session (
(EMFormat *) efhp,
((EMFormat *) emfv->preview)->session);
+ em_format_merge_handler ((EMFormat *) efhp,
+ (EMFormat *) emfv->preview);
+
em_format_html_print_message (
efhp, emfv->folder, uids->pdata[0]);
g_object_unref (efhp);
diff --git a/mail/em-format.c b/mail/em-format.c
index ce820cab11..aa54470409 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -224,6 +224,38 @@ em_format_class_add_handler(EMFormatClass *emfc, EMFormatHandler *info)
g_hash_table_insert(emfc->type_handlers, info->mime_type, info);
}
+struct _class_handlers {
+ EMFormatClass *old;
+ EMFormatClass *new;
+};
+static void
+merge_missing (gpointer key, gpointer value, gpointer userdata)
+{
+ struct _class_handlers *classes = (struct _class_handlers *) userdata;
+ EMFormatHandler *info, *oldinfo;
+
+ oldinfo = (EMFormatHandler *) value;
+ info = g_hash_table_lookup (classes->new->type_handlers, key);
+ if (!info) {
+ /* Might be from a plugin */
+ g_hash_table_insert (classes->new->type_handlers, key, value);
+ }
+
+}
+
+void
+em_format_merge_handler(EMFormat *new, EMFormat *old)
+{
+ EMFormatClass *oldc = (EMFormatClass *)G_OBJECT_GET_CLASS(old);
+ EMFormatClass *newc = (EMFormatClass *)G_OBJECT_GET_CLASS(new);
+ struct _class_handlers fclasses;
+
+ fclasses.old = oldc;
+ fclasses.new = newc;
+
+ g_hash_table_foreach (oldc->type_handlers, merge_missing, &fclasses);
+
+}
/**
* em_format_class_remove_handler:
* @emfc:
diff --git a/mail/em-format.h b/mail/em-format.h
index abe17f03cc..81f4b5c508 100644
--- a/mail/em-format.h
+++ b/mail/em-format.h
@@ -328,5 +328,6 @@ void em_format_format_text(EMFormat *emf, struct _CamelStream *stream, struct _C
void em_format_part_as(EMFormat *emf, struct _CamelStream *stream, struct _CamelMimePart *part, const char *mime_type);
void em_format_part(EMFormat *emf, struct _CamelStream *stream, struct _CamelMimePart *part);
+void em_format_merge_handler(EMFormat *new, EMFormat *old);
#endif /* ! _EM_FORMAT_H */