aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-attachment-handler-image.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-05-23 00:11:49 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-05-24 04:36:01 +0800
commit256422cab27d0b7adbe99fdeaceb72cd78c129bb (patch)
tree8d087e570e7656e7d088232d98c52636c95baed0 /e-util/e-attachment-handler-image.c
parent37c5951635a4f45ba26b0f95ce7af61275d47fba (diff)
downloadgsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.gz
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.bz2
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.lz
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.xz
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.tar.zst
gsoc2013-evolution-256422cab27d0b7adbe99fdeaceb72cd78c129bb.zip
Attachment-related cleanups.
Diffstat (limited to 'e-util/e-attachment-handler-image.c')
-rw-r--r--e-util/e-attachment-handler-image.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/e-util/e-attachment-handler-image.c b/e-util/e-attachment-handler-image.c
index 36c3a83614..602f001ba6 100644
--- a/e-util/e-attachment-handler-image.c
+++ b/e-util/e-attachment-handler-image.c
@@ -155,9 +155,7 @@ attachment_handler_image_update_actions_cb (EAttachmentView *view,
EAttachmentHandler *handler)
{
EAttachment *attachment;
- GFileInfo *file_info;
GtkActionGroup *action_group;
- const gchar *content_type;
gchar *mime_type;
GList *selected;
gboolean visible = FALSE;
@@ -168,10 +166,6 @@ attachment_handler_image_update_actions_cb (EAttachmentView *view,
goto exit;
attachment = E_ATTACHMENT (selected->data);
- file_info = e_attachment_get_file_info (attachment);
-
- if (file_info == NULL)
- goto exit;
if (e_attachment_get_loading (attachment))
goto exit;
@@ -179,10 +173,10 @@ attachment_handler_image_update_actions_cb (EAttachmentView *view,
if (e_attachment_get_saving (attachment))
goto exit;
- content_type = g_file_info_get_content_type (file_info);
-
- mime_type = g_content_type_get_mime_type (content_type);
- visible = (g_ascii_strncasecmp (mime_type, "image/", 6) == 0);
+ mime_type = e_attachment_get_mime_type (attachment);
+ visible =
+ (mime_type != NULL) &&
+ (g_ascii_strncasecmp (mime_type, "image/", 6) == 0);
g_free (mime_type);
exit: