Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>2006-04-02 23:24:26 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@src.gnome.org>2006-04-02 23:24:26 (GMT)
commita4a3a2301361cb6a71e1b127e8e43589f2749105 (patch)
treef70db318215d8b3517999c0ad58407ff366536ef /backend
parentf0d4f37e3b6a3433c15e1e35236c1ccffeca4bee (diff)
Cleanup mime type detection on document load. Fix for the bug #336448.
* backend/ev-document-factory.c: (get_document_from_uri), (ev_document_factory_get_document): * backend/ev-document-factory.h: * properties/ev-properties-main.c: (ev_properties_get_pages): * shell/Makefile.am: * shell/ev-job-queue.c: (handle_job), (search_for_jobs_unlocked), (no_jobs_available_unlocked), (ev_job_queue_init), (find_queue), (ev_job_queue_remove_job): * shell/ev-job-queue.h: * shell/ev-job-xfer.c: * shell/ev-job-xfer.h: * shell/ev-jobs.c: (ev_job_fonts_init), (ev_job_fonts_class_init), (ev_job_fonts_new), (ev_job_fonts_run), (ev_job_xfer_init), (ev_job_xfer_dispose), (ev_job_xfer_class_init), (ev_job_xfer_new), (ev_job_xfer_run): * shell/ev-jobs.h: * shell/ev-window.c: (ev_window_is_empty), (password_dialog_response), (ev_window_clear_xfer_job), (ev_window_xfer_job_cb), (ev_window_open_uri), (ev_window_cmd_focus_page_selector), (ev_window_cmd_scroll_forward), (ev_window_cmd_scroll_backward), (ev_window_cmd_continuous), (ev_window_cmd_dual), (ev_window_cmd_view_best_fit), (ev_window_cmd_view_page_width), (ev_window_dispose): * thumbnailer/evince-thumbnailer.c: (evince_thumbnail_pngenc_get): * Cleanup mime type detection on document load. Fix for the bug #336448.
Diffstat (limited to 'backend')
-rw-r--r--backend/ev-document-factory.c28
-rw-r--r--backend/ev-document-factory.h3
2 files changed, 17 insertions, 14 deletions
diff --git a/backend/ev-document-factory.c b/backend/ev-document-factory.c
index c7314ec..c02801f 100644
--- a/backend/ev-document-factory.c
+++ b/backend/ev-document-factory.c
@@ -142,7 +142,7 @@ mime_type_supported_by_gdk_pixbuf (const gchar *mime_type)
}
#endif
-EvDocument*
+static EvDocument*
ev_document_factory_get_from_mime (const char *mime_type)
{
int i;
@@ -230,7 +230,7 @@ ev_document_factory_get_all_mime_types (void)
}
static EvDocument *
-get_document_from_uri (const char *uri, gboolean slow, gchar **mime_type, GError **error)
+get_document_from_uri (const char *uri, gboolean slow, GError **error)
{
EvDocument *document = NULL;
@@ -271,32 +271,36 @@ get_document_from_uri (const char *uri, gboolean slow, gchar **mime_type, GError
return NULL;
}
- if (mime_type != NULL) {
- *mime_type = g_strdup (info->mime_type);
- }
-
gnome_vfs_file_info_unref (info);
return document;
}
EvDocument *
-ev_document_factory_get_document (const char *uri, gchar **mime_type, GError **error)
+ev_document_factory_get_document (const char *uri, GError **error)
{
EvDocument *document;
- document = get_document_from_uri (uri, FALSE, mime_type, error);
+ document = get_document_from_uri (uri, FALSE, error);
- if (document != NULL) {
- return document;
+ if (*error != NULL) {
+ return NULL;
}
+
+ ev_document_load (document, uri, error);
- if (error) {
+ if (*error) {
g_error_free (*error);
*error = NULL;
}
- document = get_document_from_uri (uri, TRUE, mime_type, error);
+ document = get_document_from_uri (uri, TRUE, error);
+
+ if (*error != NULL) {
+ return NULL;
+ }
+
+ ev_document_load (document, uri, error);
return document;
}
diff --git a/backend/ev-document-factory.h b/backend/ev-document-factory.h
index b2c9659..215f50b 100644
--- a/backend/ev-document-factory.h
+++ b/backend/ev-document-factory.h
@@ -36,8 +36,7 @@ typedef enum {
EV_BACKEND_COMICS
} EvBackend;
-EvDocument* ev_document_factory_get_from_mime (const char *mime_type);
-EvDocument* ev_document_factory_get_document (const char *uri, gchar **mime_type, GError **error);
+EvDocument* ev_document_factory_get_document (const char *uri, GError **error);
EvBackend ev_document_factory_get_backend (EvDocument *document);
void ev_document_factory_add_filters (GtkWidget *chooser, EvDocument *document);