X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Fev-attachment.c;h=f0002f37230b362c22f835fe566351e23853895e;hb=34f87f02fa13028c10ebf54be39f7d0045040505;hp=9d5aaffbe398d9b150d7f079a0a674df8c835a4e;hpb=d89b1cb89ef2d589befbe7a7f0c9732ff72ecc7b;p=evince.git diff --git a/backend/ev-attachment.c b/backend/ev-attachment.c index 9d5aaffb..f0002f37 100644 --- a/backend/ev-attachment.c +++ b/backend/ev-attachment.c @@ -364,12 +364,24 @@ ev_attachment_open (EvAttachment *attachment, GError **error) { - gboolean retval = FALSE; + gboolean retval = FALSE; + GnomeVFSMimeApplication *default_app = NULL; if (!attachment->priv->app) - attachment->priv->app = - gnome_vfs_mime_get_default_application (attachment->priv->mime_type); + default_app = gnome_vfs_mime_get_default_application (attachment->priv->mime_type); + if (!default_app) { + g_set_error (error, + EV_ATTACHMENT_ERROR, + 0, + _("Couldn't open attachment '%s'"), + attachment->priv->name); + + return FALSE; + } + + attachment->priv->app = default_app; + if (attachment->priv->tmp_uri && g_file_test (attachment->priv->tmp_uri, G_FILE_TEST_EXISTS)) { retval = ev_attachment_launch_app (attachment, error);