X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=properties%2Fev-properties-main.c;h=e0631f9765307fc9ea7dc84c0393f1875e00005a;hb=776a6fe02961d8901d21e172633d3c8d1c85dc93;hp=f726591b4fa07810f4e9ae6c5097495e7ab0d79d;hpb=a4a3a2301361cb6a71e1b127e8e43589f2749105;p=evince.git diff --git a/properties/ev-properties-main.c b/properties/ev-properties-main.c index f726591b..e0631f97 100644 --- a/properties/ev-properties-main.c +++ b/properties/ev-properties-main.c @@ -27,16 +27,19 @@ * */ -#include "ev-properties-view.h" -#include "ev-document-factory.h" - #include + #include + #include -#include +#include + #include #include +#include +#include "ev-properties-view.h" + static GType epp_type = 0; static void property_page_provider_iface_init (NautilusPropertyPageProviderIface *iface); @@ -46,7 +49,7 @@ static GList *ev_properties_get_pages static void ev_properties_plugin_register_type (GTypeModule *module) { - static const GTypeInfo info = { + const GTypeInfo info = { sizeof (GObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, @@ -57,7 +60,7 @@ ev_properties_plugin_register_type (GTypeModule *module) 0, (GInstanceInitFunc) NULL }; - static const GInterfaceInfo property_page_provider_iface_info = { + const GInterfaceInfo property_page_provider_iface_info = { (GInterfaceInitFunc)property_page_provider_iface_init, NULL, NULL @@ -86,10 +89,10 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider, EvDocument *document; GList *pages = NULL; NautilusFileInfo *file; - char *uri = NULL; + gchar *uri = NULL; + gchar *mime_type = NULL; GtkWidget *page, *label; NautilusPropertyPage *property_page; - GType type = G_TYPE_INVALID; /* only add properties page if a single file is selected */ if (files == NULL || files->next != NULL) @@ -97,20 +100,21 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider, file = files->data; /* okay, make the page */ - - if (document == NULL) - goto end; - uri = nautilus_file_info_get_uri (file); - document = ev_document_factory_get_document (uri, &error); + mime_type = nautilus_file_info_get_mime_type (file); + + document = ev_backends_manager_get_document (mime_type); + if (!document) + goto end; + ev_document_load (document, uri, &error); if (error) { g_error_free (error); goto end; } - + label = gtk_label_new (_("Document")); - page = ev_properties_view_new (); + page = ev_properties_view_new (uri); ev_properties_view_set_info (EV_PROPERTIES_VIEW (page), ev_document_get_info (document)); gtk_widget_show (page); @@ -122,6 +126,8 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider, end: g_free (uri); + g_free (mime_type); + return pages; } @@ -132,14 +138,13 @@ nautilus_module_initialize (GTypeModule *module) ev_properties_plugin_register_type (module); ev_properties_view_register_type (module); - /* set up translation catalog */ - bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + ev_init (); } void nautilus_module_shutdown (void) { + ev_shutdown (); } void @@ -152,4 +157,3 @@ nautilus_module_list_types (const GType **types, *types = type_list; *num_types = G_N_ELEMENTS (type_list); } -