summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2010-06-02 11:45:32 -0500
committerShaun McCance <shaunm@gnome.org>2010-06-02 17:55:33 -0500
commitf6e059c1f443ac6f5c0793e5bf9a73b612975f2f (patch)
treefea314ca8e80e0279e9dcf7fc7e94509e3d2d680
parent4c8152d1bd1dabeefda9b4e1f8454e7868b59172 (diff)
downloadyelp-f6e059c1f443ac6f5c0793e5bf9a73b612975f2f.tar.gz
[yelp-window] Make sure bookmark actions have the right title when switching docs
-rw-r--r--src/yelp-window.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/yelp-window.c b/src/yelp-window.c
index a434c813..fdffdbf3 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -924,7 +924,17 @@ window_set_bookmarks (YelpWindow *window,
gchar *action_id = g_strconcat ("LoadBookmark-", entry->page_id, NULL);
bookmark = gtk_action_group_get_action (priv->bookmark_actions, action_id);
- if (bookmark == NULL) {
+ if (bookmark) {
+ /* The action might have been set by a different document using
+ * the same page ID. We can just reuse the action, since it's
+ * just a page ID relative to the current URI, but we need to
+ * reset the title and icon.
+ */
+ g_object_set (bookmark,
+ "label", entry->title,
+ "icon-name", entry->icon,
+ NULL);
+ } else {
bookmark = gtk_action_new (action_id, entry->title, NULL, NULL);
g_signal_connect (bookmark, "activate",
G_CALLBACK (window_load_bookmark), window);