summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2010-05-18 12:50:42 -0500
committerShaun McCance <shaunm@gnome.org>2010-05-18 12:50:42 -0500
commit053c89db4b6f97cc1cfb85079234ef6915067979 (patch)
tree5de63d89f53f7ed86bc9ed28c1abc2da68479d8f
parente2482e393bda8213b0af8c693e32045b1418b9b1 (diff)
downloadyelp-053c89db4b6f97cc1cfb85079234ef6915067979.tar.gz
[libyelp/yelp-view.c] Fix page refs for file:///-referenced Mallard docs
-rw-r--r--libyelp/yelp-view.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index 01ec1b98..c8fbde62 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -1235,6 +1235,7 @@ document_callback (YelpDocument *document,
g_signal_emit_by_name (view, "notify::page-icon", spec);
}
else if (signal == YELP_DOCUMENT_SIGNAL_CONTENTS) {
+ YelpUriDocumentType doctype;
const gchar *contents;
gchar *mime_type, *page_id, *frag_id, *full_uri;
page_id = yelp_uri_get_page_id (priv->uri);
@@ -1266,8 +1267,12 @@ document_callback (YelpDocument *document,
based on actual file locations, but in fact it doesn't matter. So
we just make a bogus URI that's easy to process later.
*/
+ doctype = yelp_uri_get_document_type (priv->uri);
full_uri = yelp_uri_get_canonical_uri (priv->uri);
- if (g_str_has_prefix (full_uri, "file:/")) {
+ if (g_str_has_prefix (full_uri, "file:/") &&
+ (doctype == YELP_URI_DOCUMENT_TYPE_TEXT ||
+ doctype == YELP_URI_DOCUMENT_TYPE_HTML ||
+ doctype == YELP_URI_DOCUMENT_TYPE_XHTML )) {
priv->bogus_uri = full_uri;
}
else {