evince r3443 - in trunk: . libdocument



Author: chpe
Date: Sun Feb 15 13:52:04 2009
New Revision: 3443
URL: http://svn.gnome.org/viewvc/evince?rev=3443&view=rev

Log:
	* libdocument/ev-document-factory.c: (get_document_from_uri): Use the
	content type to get the description, not the MIME type.

Modified:
   trunk/ChangeLog
   trunk/libdocument/ev-document-factory.c

Modified: trunk/libdocument/ev-document-factory.c
==============================================================================
--- trunk/libdocument/ev-document-factory.c	(original)
+++ trunk/libdocument/ev-document-factory.c	Sun Feb 15 13:52:04 2009
@@ -138,15 +138,19 @@
 #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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]