diff options
author | Christian Persch <chpe@src.gnome.org> | 2009-02-15 13:52:04 (GMT) |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2009-02-15 13:52:04 (GMT) |
commit | 0c6afa0a95bba78223de0a44653267683597e5ba (patch) | |
tree | 5b048598037f6ee9f496ab060311ef91ebf5946c | |
parent | 7b0368829c39a9c1d78a785164bfe1c5d1f9f6ff (diff) |
Use the content type to get the description, not the MIME type.
* libdocument/ev-document-factory.c: (get_document_from_uri): Use the
content type to get the description, not the MIME type.
svn path=/trunk/; revision=3443
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | libdocument/ev-document-factory.c | 10 |
2 files changed, 12 insertions, 3 deletions
@@ -1,5 +1,10 @@ 2009-02-14 Christian Persch <chpe@gnome.org> + * libdocument/ev-document-factory.c: (get_document_from_uri): Use the + content type to get the description, not the MIME type. + +2009-02-14 Christian Persch <chpe@gnome.org> + * libdocument/ev-file-helpers.c: (compression_run): Make sure to fill in @error on failure. Also, since this is exported in public APIs, cope with the passed-in GError** being NULL. diff --git a/libdocument/ev-document-factory.c b/libdocument/ev-document-factory.c index c7f2a22..f0172ff 100644 --- a/libdocument/ev-document-factory.c +++ b/libdocument/ev-document-factory.c @@ -138,15 +138,19 @@ get_document_from_uri (const char *uri, #endif /* ENABLE_PIXBUF */ if (document == NULL) { - gchar *mime_desc; + gchar *content_type, *mime_desc = NULL; + + content_type = g_content_type_from_mime_type (mime_type); + if (content_type) + mime_desc = g_content_type_get_description (content_type); - mime_desc = g_content_type_get_description (mime_type); g_set_error (error, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_INVALID, _("File type %s (%s) is not supported"), - mime_desc, mime_type); + mime_desc ? mime_desc : "-", mime_type); g_free (mime_desc); + g_free (content_type); g_free (mime_type); return NULL; |