diff options
author | Nickolay V. Shmyrev <nshmyrev@yandex.ru> | 2006-10-08 07:29:56 (GMT) |
---|---|---|
committer | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2006-10-08 07:29:56 (GMT) |
commit | 217f85b9017e614505bf4a654d5b282921ff0d9e (patch) | |
tree | 538031b89ddc6ff1d60e713f4ff5353e07b71c73 /backend | |
parent | f18c30d6207d3a4d369c9c2989ae4d90590b88a9 (diff) |
Load document even if extension is wrong.
2006-10-08 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
* backend/ev-document-factory.c:
(ev_document_factory_get_document):
Load document even if extension is wrong.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/ev-document-factory.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/backend/ev-document-factory.c b/backend/ev-document-factory.c index 3b3f701..a2ea526 100644 --- a/backend/ev-document-factory.c +++ b/backend/ev-document-factory.c @@ -291,21 +291,19 @@ ev_document_factory_get_document (const char *uri, GError **error) document = get_document_from_uri (uri, FALSE, error); - if (*error != NULL) { - return NULL; - } - - result = ev_document_load (document, uri, error); - - if (result == FALSE || *error) { - if (*error && - (*error)->domain == EV_DOCUMENT_ERROR && - (*error)->code == EV_DOCUMENT_ERROR_ENCRYPTED) + if (*error == NULL) { + result = ev_document_load (document, uri, error); + + if (result == FALSE || *error) { + if (*error && + (*error)->domain == EV_DOCUMENT_ERROR && + (*error)->code == EV_DOCUMENT_ERROR_ENCRYPTED) + return document; + } else { return document; - } else { - return document; + } } - + /* Try again with slow mime detection */ if (document) g_object_unref (document); |