X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=properties%2Fev-properties-main.c;h=3b1e8e06eb3b490a03d55d26c6fa40fa21873cef;hb=0158218ce547e17e1684a0cb6a3e7b58f700caee;hp=87f4a59012927a8b2965bf6c443e138ba06b81fb;hpb=8f535d303b8985db357abc54cb4d3fe1ff7e84bd;p=evince.git diff --git a/properties/ev-properties-main.c b/properties/ev-properties-main.c index 87f4a590..3b1e8e06 100644 --- a/properties/ev-properties-main.c +++ b/properties/ev-properties-main.c @@ -28,7 +28,7 @@ */ #include "ev-properties-view.h" -#include "pdf-document.h" +#include "ev-document-factory.h" #include #include @@ -82,30 +82,28 @@ static GList * ev_properties_get_pages (NautilusPropertyPageProvider *provider, GList *files) { - GError *error; + GError *error = NULL; EvDocument *document; GList *pages = NULL; NautilusFileInfo *file; char *uri = NULL; GtkWidget *page, *label; NautilusPropertyPage *property_page; - + /* only add properties page if a single file is selected */ if (files == NULL || files->next != NULL) goto end; file = files->data; - if (!nautilus_file_info_is_mime_type (file, "application/pdf")) { - goto end; - } - /* okay, make the page */ - document = EV_DOCUMENT (pdf_document_new ()); uri = nautilus_file_info_get_uri (file); - if (!ev_document_load (document, uri, &error)) { + document = ev_document_factory_get_document (uri, &error); + + if (error) { g_error_free (error); goto end; } + label = gtk_label_new (_("Document")); page = ev_properties_view_new (); ev_properties_view_set_info (EV_PROPERTIES_VIEW (page),