Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/libdocument
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2009-03-02 23:38:23 (GMT)
committer Christian Persch <chpe@src.gnome.org>2009-03-02 23:38:23 (GMT)
commitba361765be1028a43646d149824f92eadfebaba4 (patch)
treeaf72479ee9b5bd7c9f148798c2516238f742fd49 /libdocument
parent36f93b0bf45608eb24e10c74aa6f818330498767 (diff)
If the document is encrypted, the ev_document_factory_get_document() is
* 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
Diffstat (limited to 'libdocument')
-rw-r--r--libdocument/ev-document-factory.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libdocument/ev-document-factory.c b/libdocument/ev-document-factory.c
index 3173d02..c2d9b61 100644
--- a/libdocument/ev-document-factory.c
+++ b/libdocument/ev-document-factory.c
@@ -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;
}