diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-03-18 00:45:04 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-03-18 00:45:04 +0800 |
commit | e1328c5de8a59be3467366b7376ae7c3696929bf (patch) | |
tree | b598fa91119bad508607985d4ac7bd0f39793272 /mail | |
parent | ef2cd88d7ab95b066599650d8bab0f167897c37a (diff) | |
download | gsoc2013-evolution-e1328c5de8a59be3467366b7376ae7c3696929bf.tar gsoc2013-evolution-e1328c5de8a59be3467366b7376ae7c3696929bf.tar.gz gsoc2013-evolution-e1328c5de8a59be3467366b7376ae7c3696929bf.tar.bz2 gsoc2013-evolution-e1328c5de8a59be3467366b7376ae7c3696929bf.tar.lz gsoc2013-evolution-e1328c5de8a59be3467366b7376ae7c3696929bf.tar.xz gsoc2013-evolution-e1328c5de8a59be3467366b7376ae7c3696929bf.tar.zst gsoc2013-evolution-e1328c5de8a59be3467366b7376ae7c3696929bf.zip |
Lookup the handler for the type. If we don't have a registered handler or
2003-03-17 Jeffrey Stedfast <fejj@ximian.com>
* mail-display.c (do_external_viewer): Lookup the handler for the
type. If we don't have a registered handler or if the registered
handler is not meant to be handled via a bonobo component, don't
use a bonobo component.
* mail-format.c (mail_lookup_handler): If we register a new
handler that is to be handled by a bonobo component, set
handler->is_bonobo to TRUE.
svn path=/trunk/; revision=20311
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 11 | ||||
-rw-r--r-- | mail/mail-display.c | 5 | ||||
-rw-r--r-- | mail/mail-format.c | 5 | ||||
-rw-r--r-- | mail/mail-format.h | 3 |
4 files changed, 23 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 769d19d4b7..3addafc3e2 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2003-03-17 Jeffrey Stedfast <fejj@ximian.com> + + * mail-display.c (do_external_viewer): Lookup the handler for the + type. If we don't have a registered handler or if the registered + handler is not meant to be handled via a bonobo component, don't + use a bonobo component. + + * mail-format.c (mail_lookup_handler): If we register a new + handler that is to be handled by a bonobo component, set + handler->is_bonobo to TRUE. + 2003-03-14 Dan Winship <danw@ximian.com> * component-factory.c (storage_connect, storage_connected): Update diff --git a/mail/mail-display.c b/mail/mail-display.c index 83387bde92..9ac15b4672 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1081,6 +1081,11 @@ do_external_viewer (GtkHTML *html, GtkHTMLEmbedded *eb, CORBA_Environment ev; CamelStreamMem *cstream; BonoboStream *bstream; + MailMimeHandler *handler; + + handler = mail_lookup_handler (eb->type); + if (!handler || !handler->is_bonobo) + return FALSE; component = gnome_vfs_mime_get_default_component (eb->type); if (!component) diff --git a/mail/mail-format.c b/mail/mail-format.c index 67a4604b2c..9d4423c1af 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -419,6 +419,7 @@ mail_lookup_handler (const char *mime_type) if (handler->builtin) { handler->generic = FALSE; + handler->is_bonobo = FALSE; goto reg; } @@ -429,6 +430,7 @@ mail_lookup_handler (const char *mime_type) for (iter = components; iter; iter = iter->next) { if (component_supports (iter->data, mime_type)) { handler->generic = FALSE; + handler->is_bonobo = TRUE; handler->builtin = handle_via_bonobo; handler->component = Bonobo_ServerInfo_duplicate (iter->data); gnome_vfs_mime_component_list_free (components); @@ -451,6 +453,7 @@ mail_lookup_handler (const char *mime_type) if (handler->builtin) { handler->generic = TRUE; + handler->is_bonobo = FALSE; if (handler->component) { CORBA_free (handler->component); handler->component = NULL; @@ -461,6 +464,7 @@ mail_lookup_handler (const char *mime_type) /* Try for a generic component match. */ if (handler->component) { handler->generic = TRUE; + handler->is_bonobo = TRUE; handler->builtin = handle_via_bonobo; goto reg; } @@ -468,6 +472,7 @@ mail_lookup_handler (const char *mime_type) /* If we at least got an application, use that. */ if (handler->applications) { handler->generic = TRUE; + handler->is_bonobo = FALSE; goto reg; } diff --git a/mail/mail-format.h b/mail/mail-format.h index fffae641ba..2bc9016879 100644 --- a/mail/mail-format.h +++ b/mail/mail-format.h @@ -52,10 +52,11 @@ gboolean mail_content_loaded (CamelDataWrapper *wrapper, typedef gboolean (*MailMimeHandlerFn) (CamelMimePart *part, const char *mime_type, MailDisplay *md, MailDisplayStream *stream); typedef struct { - gboolean generic; Bonobo_ServerInfo *component; GList *applications; MailMimeHandlerFn builtin; + guint generic : 1; + guint is_bonobo : 1; } MailMimeHandler; MailMimeHandler *mail_lookup_handler (const char *mime_type); |