]> www.fi.muni.cz Git - evince.git/commitdiff
If the document is encrypted, the ev_document_factory_get_document() is EVINCE_2_25_92
authorChristian Persch <chpe@src.gnome.org>
Mon, 2 Mar 2009 23:38:23 +0000 (23:38 +0000)
committerChristian Persch <chpe@src.gnome.org>
Mon, 2 Mar 2009 23:38:23 +0000 (23:38 +0000)
* libdocument/ev-document-factory.c:
(ev_document_factory_get_document): If the document is encrypted,
the ev_document_factory_get_document() is supposed to return the
        document *and* fill in the error. So let's propagate the local error.

svn path=/trunk/; revision=3512

ChangeLog
libdocument/ev-document-factory.c

index 681534ba7597d8f5f0727dc482fc331735a31402..4a3df34e840b5948d99d811fc1835f97ee57ce84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-03-03  Christian Persch  <chpe@gnome.org>
+
+       * libdocument/ev-document-factory.c:
+       (ev_document_factory_get_document): If the document is encrypted,
+       the ev_document_factory_get_document() is supposed to return the
+        document *and* fill in the error. So let's propagate the local error.
+
 2009-03-02  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * NEWS:
index 3173d029f191352213cbc7d4dad0ea358675f2a3..c2d9b61cb55793e91a4d4b73d025ffa45e26f319 100644 (file)
@@ -199,6 +199,8 @@ free_uncompressed_uri (gchar *uri_unc)
  * Creates a #EvDocument for the document at @uri; or, if no backend handling
  * the document's type is found, or an error occurred on opening the document,
  * returns %NULL and fills in @error.
+ * If the document is encrypted, it is returned but also @error is set to
+ * %EV_DOCUMENT_ERROR_ENCRYPTED.
  *
  * Returns: a new #EvDocument, or %NULL.
  */
@@ -235,7 +237,7 @@ ev_document_factory_get_document (const char *uri, GError **error)
                if (result == FALSE || err) {
                        if (err &&
                            g_error_matches (err, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_ENCRYPTED)) {
-                               g_error_free (err);
+                               g_propagate_error (error, err);
                                return document;
                            }
                        /* else fall through to slow mime code section below */
@@ -283,7 +285,7 @@ ev_document_factory_get_document (const char *uri, GError **error)
                                              EV_DOCUMENT_ERROR_INVALID,
                                              _("Unknown MIME Type"));
                } else if (g_error_matches (err, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_ENCRYPTED)) {
-                       g_error_free (err);
+                       g_propagate_error (error, err);
                        return document;
                }