]> www.fi.muni.cz Git - evince.git/commitdiff
Use the content type to get the description, not the MIME type.
authorChristian Persch <chpe@src.gnome.org>
Sun, 15 Feb 2009 13:52:04 +0000 (13:52 +0000)
committerChristian Persch <chpe@src.gnome.org>
Sun, 15 Feb 2009 13:52:04 +0000 (13:52 +0000)
* 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

ChangeLog
libdocument/ev-document-factory.c

index 4a0fcf902688ed0df52d20ca1009eb247ba88c03..83af46796b1be9eceef8b89bc18d54c919fb98ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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
index c7f2a224a21ecfa59d80528ba45fb02b041103d7..f0172ff8f4a4db86edd9ec32af2de5cab8e89a91 100644 (file)
@@ -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;