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=6af16f36ad7301ecc9fcff69eee13c019a084c08;hb=dec10c13ca0e95a58e9d6eb537320505ca64d1f8;hp=64f5707bf6fc22ca09044a2c271427e05c08dce6;hpb=ffd47fa767f69c0b534037a6e067534d7d2345c9;p=evince.git diff --git a/properties/ev-properties-main.c b/properties/ev-properties-main.c index 64f5707b..6af16f36 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 @@ -82,8 +85,7 @@ static GList * ev_properties_get_pages (NautilusPropertyPageProvider *provider, GList *files) { - GError *error; - char *mime; + GError *error = NULL; EvDocument *document; GList *pages = NULL; NautilusFileInfo *file; @@ -96,19 +98,20 @@ ev_properties_get_pages (NautilusPropertyPageProvider *provider, goto end; file = files->data; - /* okay, make the page */ - mime = nautilus_file_info_get_mime_type (file); - document = ev_document_factory_get_document (mime); - g_free (mime); - 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; } + + if (!document) + 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); @@ -130,14 +133,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 @@ -150,4 +152,3 @@ nautilus_module_list_types (const GType **types, *types = type_list; *num_types = G_N_ELEMENTS (type_list); } -