X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Fev-attachment.c;h=331473814f3a8cc95bcbe76c5bae0edf22cb6f0e;hb=874a53523a08189589452097624476c436e018fc;hp=f0002f37230b362c22f835fe566351e23853895e;hpb=34f87f02fa13028c10ebf54be39f7d0045040505;p=evince.git diff --git a/backend/ev-attachment.c b/backend/ev-attachment.c index f0002f37..33147381 100644 --- a/backend/ev-attachment.c +++ b/backend/ev-attachment.c @@ -367,10 +367,14 @@ ev_attachment_open (EvAttachment *attachment, gboolean retval = FALSE; GnomeVFSMimeApplication *default_app = NULL; - if (!attachment->priv->app) + g_return_val_if_fail (EV_IS_ATTACHMENT (attachment), FALSE); + + if (!attachment->priv->app) { default_app = gnome_vfs_mime_get_default_application (attachment->priv->mime_type); + attachment->priv->app = default_app; + } - if (!default_app) { + if (!attachment->priv->app) { g_set_error (error, EV_ATTACHMENT_ERROR, 0, @@ -380,8 +384,6 @@ ev_attachment_open (EvAttachment *attachment, 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);