[yelp/yelp-3-0] [yelp-window.c] Temporarily put frag IDs in location entry



commit b519e961e8f8c6139f0ccf70bddfbc29c3f6c9e9
Author: Shaun McCance <shaunm gnome org>
Date:   Mon Mar 15 10:30:40 2010 -0500

    [yelp-window.c] Temporarily put frag IDs in location entry
    
    We're getting confusing seemingly duplicate entries in the location
    entry when we go to fragments of pages.  We want to get the actual
    fragment title, possibly mixed with the page title.  That requires
    some work on YelpDocument and YelpView.  For now, put in the frag
    ID to disambiguate and remind me to fix this properly.

 src/yelp-window.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/src/yelp-window.c b/src/yelp-window.c
index e67c674..9b07e2e 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -246,17 +246,33 @@ view_page_title (YelpView    *view,
                  YelpWindow  *window)
 {
     GtkTreeIter first;
-    gchar *title;
+    gchar *title, *frag;
+    YelpUri *uri;
     YelpWindowPrivate *priv = GET_PRIV (window);
 
     g_object_get (view, "page-title", &title, NULL);
     if (title == NULL)
         return;
 
+    g_object_get (view, "yelp-uri", &uri, NULL);
+    frag = yelp_uri_get_frag_id (uri);
+
     gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->history), &first);
-    gtk_list_store_set (priv->history, &first,
-                        COL_TITLE, title,
-                        -1);
+    if (frag) {
+        gchar *tmp = g_strdup_printf ("%s (#%s)", title, frag);
+        gtk_list_store_set (priv->history, &first,
+                            COL_TITLE, tmp,
+                            -1);
+        g_free (tmp);
+        g_free (frag);
+    }
+    else {
+        gtk_list_store_set (priv->history, &first,
+                            COL_TITLE, title,
+                            -1);
+    }
+
+    g_object_unref (uri);
 }
 
 static void



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