diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-10-05 13:45:28 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-10-05 13:45:28 +0800 |
commit | e188aba01b54c93555963969f008a04c3ca3fa0b (patch) | |
tree | 2abe68ebe0b9ea8de0369fc34366aa003ef194d4 /mail/em-format.c | |
parent | c44d7bdc7305613757ea5b2a2b3187face5500cb (diff) | |
download | gsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.tar.gz gsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.tar.zst gsoc2013-evolution-e188aba01b54c93555963969f008a04c3ca3fa0b.zip |
** Fix for bug #468736
svn path=/trunk/; revision=34355
Diffstat (limited to 'mail/em-format.c')
-rw-r--r-- | mail/em-format.c | 32 |
1 files changed, 32 insertions, 0 deletions
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: |