]> www.fi.muni.cz Git - evince.git/blobdiff - thumbnailer/evince-thumbnailer.c
disable File->Print if the document does not implement the ps exporter
[evince.git] / thumbnailer / evince-thumbnailer.c
index f9930bbff3f7f6655fa1172e7604c5f3522b086f..c4a02cb6b7193c31374a6c03fae05e520265a9d8 100644 (file)
@@ -33,17 +33,13 @@ static gboolean
 evince_thumbnail_pngenc_get (const char *uri, const char *thumbnail, int size)
 {
        EvDocument *document = NULL;
-       char *mime_type;
        GError *error = NULL;
        GdkPixbuf *pixbuf;
        GType document_type;
+       char *mime_type = NULL;
 
-       mime_type = gnome_vfs_get_mime_type (uri);
-       if (mime_type == NULL)
-               return FALSE;
-
-       document_type = ev_document_type_lookup (mime_type);
-       if (document_type==G_TYPE_INVALID)
+       document_type = ev_document_type_lookup (uri, &mime_type, &error);
+       if (document_type == G_TYPE_INVALID || error != NULL)
                return FALSE;
 
        document = g_object_new (document_type, NULL);
@@ -62,12 +58,12 @@ evince_thumbnail_pngenc_get (const char *uri, const char *thumbnail, int size)
        }
 
        pixbuf = ev_document_thumbnails_get_thumbnail
-                       (EV_DOCUMENT_THUMBNAILS (document), 1, size, FALSE);
+                       (EV_DOCUMENT_THUMBNAILS (document), 0, size, FALSE);
        
        if (pixbuf != NULL) {
                const char *overlaid_icon_name = NULL;
 
-               if (strcmp(mime_type,"application/pdf")==0) {
+               if (strcmp (mime_type, "application/pdf") == 0) {
                        overlaid_icon_name = "pdf-icon.png";
                }