}
#endif
-EvDocument*
+static EvDocument*
ev_document_factory_get_from_mime (const char *mime_type)
{
int i;
}
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;
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;
}