diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-04-29 00:00:47 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-04-29 00:00:47 +0800 |
commit | aea82dfd606493e4a65f1088e631fe394746d8f0 (patch) | |
tree | a572a6d77770d08c3f0f3b5ea2b481da04bb2b11 /mail/mail-format.c | |
parent | d4876ac1ade43af853f5e0e47a73f9532211f214 (diff) | |
download | gsoc2013-evolution-aea82dfd606493e4a65f1088e631fe394746d8f0.tar.gz gsoc2013-evolution-aea82dfd606493e4a65f1088e631fe394746d8f0.tar.zst gsoc2013-evolution-aea82dfd606493e4a65f1088e631fe394746d8f0.zip |
Made toplevel container widgets set a border-width (including toplevel
2003-04-25 Jeffrey Stedfast <fejj@ximian.com>
* mail-config.glade: Made toplevel container widgets set a
border-width (including toplevel widgets within frames), set the
table/hbox/vbox spacings, set the spacing between an image and the
description text in hboxes to 12pts (as suggested by the HIG),
Changed Add/Delete buttons to the stock Add/Remove buttons, etc
2003-04-24 Jeffrey Stedfast <fejj@ximian.com>
* mail-config.c (mail_config_init): Cache the allowable
mime-types.
(mail_config_get_allowable_mime_types): New public function to get
an array of allowable mime-types.
* mail-format.c (mail_lookup_handler): Only allow a
bonobo-component handler if the mime-type is something handled by
evolution or the user has specifically chosen that type as
available for viewing with a bonobo component in the gconf
database.
(mime_type_uses_evolution_component): New convenience function.
(mime_type_can_use_component): Checks gconf to see if the user has
allowed the mime-type to be viewed by a component.
svn path=/trunk/; revision=20983
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r-- | mail/mail-format.c | 53 |
1 files changed, 39 insertions, 14 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c index f47ebccd4d..5840e16e70 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -371,6 +371,27 @@ component_supports (Bonobo_ServerInfo *component, const char *mime_type) return FALSE; } +static gboolean +mime_type_uses_evolution_component (const char *mime_type) +{ + return (!strcmp (mime_type, "text/x-vcard") || !strcmp (mime_type, "text/calendar")); +} + +static gboolean +mime_type_can_use_component (const char *mime_type) +{ + const char **mime_types; + int i; + + mime_types = mail_config_get_allowable_mime_types (); + for (i = 0; mime_types[i]; i++) { + if (!strcmp (mime_types[i], mime_type)) + return TRUE; + } + + return FALSE; +} + /** * mail_lookup_handler: * @mime_type: a MIME type @@ -423,23 +444,27 @@ mail_lookup_handler (const char *mime_type) goto reg; } - /* Try for the first matching component. (we don't use get_short_list_comps - * as that will return NULL if the oaf files don't have the short_list properties - * defined). */ - components = gnome_vfs_mime_get_all_components (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); - goto reg; + /* only allow using a bonobo component if it is an evo-component or the user has + * specified that we can use a bonobo-component by setting the gconf key */ + if (mime_type_uses_evolution_component (mime_type) || mime_type_can_use_component (mime_type)) { + /* Try for the first matching component. (we don't use get_short_list_comps + * as that will return NULL if the oaf files don't have the short_list properties + * defined). */ + components = gnome_vfs_mime_get_all_components (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); + goto reg; + } } + + gnome_vfs_mime_component_list_free (components); } - gnome_vfs_mime_component_list_free (components); - /* Try for a generic builtin match. */ p = strchr (mime_type, '/'); if (p == NULL) |