diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.c | 30 |
2 files changed, 39 insertions, 0 deletions
@@ -1,5 +1,14 @@ 2004-03-01 Christian Persch <chpe@cvs.gnome.org> + * src/bookmarks/ephy-bookmark-action.c: (smart_child_added_cb), + (smart_child_removed_cb), (ephy_bookmark_action_init): + + Correctly sync the smarturl property of EphyBookmarksAction when + it changes. Fixes incorrect show/hide of the entry on the bookmarks + toolbar. + +2004-03-01 Christian Persch <chpe@cvs.gnome.org> + * src/bookmarks/ephy-bookmarks.c: (update_has_smart_address): When changing a bookmark address and it was a smart bookmark but diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index ee2104506..68bad78fd 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -525,6 +525,29 @@ bookmarks_child_changed_cb (EphyNode *node, } static void +smart_child_added_cb (EphyNode *smart_bmks, + EphyNode *child, + EphyBookmarkAction *action) +{ + if (action->priv->bookmark_id == ephy_node_get_id (child)) + { + g_object_set (action, "smarturl", TRUE, NULL); + } +} + +static void +smart_child_removed_cb (EphyNode *smart_bmks, + EphyNode *child, + guint old_index, + EphyBookmarkAction *action) +{ + if (action->priv->bookmark_id == ephy_node_get_id (child)) + { + g_object_set (action, "smarturl", FALSE, NULL); + } +} + +static void ephy_bookmark_action_init (EphyBookmarkAction *action) { EphyBookmarks *bookmarks; @@ -540,6 +563,13 @@ ephy_bookmark_action_init (EphyBookmarkAction *action) ephy_node_signal_connect_object (node, EPHY_NODE_CHILD_CHANGED, (EphyNodeCallback) bookmarks_child_changed_cb, G_OBJECT (action)); + node = ephy_bookmarks_get_smart_bookmarks (bookmarks); + ephy_node_signal_connect_object (node, EPHY_NODE_CHILD_ADDED, + (EphyNodeCallback) smart_child_added_cb, + G_OBJECT (action)); + ephy_node_signal_connect_object (node, EPHY_NODE_CHILD_REMOVED, + (EphyNodeCallback) smart_child_removed_cb, + G_OBJECT (action)); } GtkAction * |