diff options
author | Shaun McCance <shaunm@gnome.org> | 2009-08-26 12:43:04 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2009-08-26 16:57:06 -0500 |
commit | a1bf8d358e5df30d82306a26d74233f1c6843e51 (patch) | |
tree | 4b7201ef82ecfe8e12627b6b9fffd3dc51114f29 | |
parent | 75dea8184229f8b2436a5a74ffb3cbf66c5218f5 (diff) | |
download | yelp-a1bf8d358e5df30d82306a26d74233f1c6843e51.tar.gz |
"Fixed" broken history for sections in Mallard documents.
-rw-r--r-- | src/yelp-window.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/yelp-window.c b/src/yelp-window.c index b5aff6cc..b2ae6bd8 100644 --- a/src/yelp-window.c +++ b/src/yelp-window.c @@ -2352,6 +2352,7 @@ window_enable_cursor_cb (GtkAction *action, YelpWindow *window) static void history_load_entry (YelpWindow *window, YelpHistoryEntry *entry) { + gchar *slash, *frag_id; g_return_if_fail (YELP_IS_WINDOW (window)); if (entry->type == YELP_RRN_TYPE_HTML || entry->type == YELP_RRN_TYPE_XHTML || entry->type == YELP_RRN_TYPE_TEXT) { @@ -2364,10 +2365,21 @@ history_load_entry (YelpWindow *window, YelpHistoryEntry *entry) g_free (window->priv->base_uri); window->priv->base_uri = g_strdup (entry->base_uri); window->priv->current_document = entry->doc; + + /* FIXME: Super hacky. We want the part before the slash for mallard IDs, + because right now we're outputting "#page_id/section_id". We ought to + be scrolling to the section as well. + */ + slash = strchr (entry->frag_id, '/'); + if (slash) + frag_id = g_strndup (entry->frag_id, slash - entry->frag_id); + else + frag_id = g_strdup (entry->frag_id); window->priv->current_request = yelp_document_get_page (entry->doc, - entry->frag_id, - (YelpDocumentFunc) page_request_cb, - (void *) window); + frag_id, + (YelpDocumentFunc) page_request_cb, + (void *) window); + g_free (frag_id); } } |