Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNickolay 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)
commit217f85b9017e614505bf4a654d5b282921ff0d9e (patch)
tree538031b89ddc6ff1d60e713f4ff5353e07b71c73
parentf18c30d6207d3a4d369c9c2989ae4d90590b88a9 (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.
-rw-r--r--ChangeLog7
-rw-r--r--backend/ev-document-factory.c24
2 files changed, 18 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index aed16a1..c89a93a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2006-10-03 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
* shell/ev-metadata-manager.c: (save_values):
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);