diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2005-07-05 15:31:17 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2005-07-05 15:31:17 (GMT) |
commit | 4684716c489657edf098565eb54bdf86bad1b45c (patch) | |
tree | 8e415778063a717a11dc09fa61042a603ff34b37 /thumbnailer | |
parent | 26a8622fe284cd0e4531caa56f918d7cfaf8037b (diff) |
Rework document types managing to avoid code duplication and actually
2005-07-05 Marco Pesenti Gritti <mpg@redhat.com>
* backend/Makefile.am:
* backend/ev-document-factory.c:
(mime_type_supported_by_gdk_pixbuf),
(ev_document_type_get_from_mime),
(ev_document_factory_get_document),
(ev_document_factory_get_backend),
(ev_document_factory_get_mime_types),
(ev_document_factory_get_all_mime_types):
* backend/ev-document-factory.h:
* shell/Makefile.am:
* shell/ev-document-types.c: (get_document_from_uri),
(ev_document_types_get_document),
(file_filter_add_mime_list_and_free),
(ev_document_types_add_filters):
* shell/ev-document-types.h:
* shell/ev-job-xfer.c: (ev_job_xfer_run):
* shell/ev-properties-dialog.c:
(ev_properties_dialog_set_document):
* shell/ev-window.c: (ev_window_cmd_file_open),
(ev_window_cmd_save_as):
* thumbnailer/evince-thumbnailer.c: (evince_thumbnail_pngenc_get):
Rework document types managing to avoid code duplication
and actually abstract from backend implementations.
Also provide a minimal factory api that can be used by
thumbnailer/properties.
Diffstat (limited to 'thumbnailer')
-rw-r--r-- | thumbnailer/evince-thumbnailer.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/thumbnailer/evince-thumbnailer.c b/thumbnailer/evince-thumbnailer.c index c4a02cb..9c67246 100644 --- a/thumbnailer/evince-thumbnailer.c +++ b/thumbnailer/evince-thumbnailer.c @@ -35,15 +35,12 @@ evince_thumbnail_pngenc_get (const char *uri, const char *thumbnail, int size) EvDocument *document = NULL; GError *error = NULL; GdkPixbuf *pixbuf; - GType document_type; char *mime_type = NULL; - document_type = ev_document_type_lookup (uri, &mime_type, &error); - if (document_type == G_TYPE_INVALID || error != NULL) + document = ev_document_types_get_document (uri, &mime_type, &error); + if (document == NULL) return FALSE; - document = g_object_new (document_type, NULL); - if (!ev_document_load (document, uri, &error)) { if (error->domain == EV_DOCUMENT_ERROR && error->code == EV_DOCUMENT_ERROR_ENCRYPTED) { |