[yelp/mallard] [yelp-window.c] Hacky temporary solution to handle links to mallard sections



commit acaffb022ca65788a873f5ca6ab73b3a4f54dd34
Author: Shaun McCance <shaunm shaunmlxlap localdomain>
Date:   Wed Jun 10 10:28:20 2009 -0500

    [yelp-window.c] Hacky temporary solution to handle links to mallard sections
---
 src/yelp-window.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/yelp-window.c b/src/yelp-window.c
index ab5f119..a59e91d 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -1140,6 +1140,7 @@ yelp_window_load (YelpWindow *window, const gchar *uri)
     }
 
     if (doc) {
+        gchar *slash;
 	gboolean need_hist = FALSE;
 	if (!frag_id)
 	  frag_id = g_strdup ("x-yelp-index");
@@ -1151,6 +1152,15 @@ yelp_window_load (YelpWindow *window, const gchar *uri)
 	window_setup_window (window, type, real_uri, frag_id,
 			     (gchar *) uri, current_base, need_hist);
 
+        /* 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.  I happen to know that get_page is
+           just going to strdup the string, and we free frag_id itself immediately
+           after this, so this is safe.  It just sucks.
+         */
+        slash = strchr (frag_id, '/');
+        if (slash)
+            *slash = '\0';
 	priv->current_request = yelp_document_get_page (doc,
 							frag_id,
 							(YelpDocumentFunc) page_request_cb,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]