From 52584020dd55c64d632c225fb17b8952538dbf1d Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 8 Oct 2004 13:44:46 +0000 Subject: When adding a bookmark, check if it has same node ID as one scheduled for 2004-10-08 Christian Persch * src/bookmarks/ephy-bookmarks-menu.c: (bookmark_added_cb): When adding a bookmark, check if it has same node ID as one scheduled for removal, and if so, process the removal immediately. Fixes bug #154805. --- src/bookmarks/ephy-bookmarks-menu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/bookmarks') diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c index 10e0dc201..62adeb395 100644 --- a/src/bookmarks/ephy-bookmarks-menu.c +++ b/src/bookmarks/ephy-bookmarks-menu.c @@ -616,6 +616,23 @@ bookmark_added_cb (EphyNode *bookmarks, if (menu->priv->bmk_actions != NULL) { + /* If the new bookmark has the node ID of one scheduled to + * be removed, remove the old one first then add new one. + * This works since the action name depends only on the + * node ID. See bug #154805. + */ + GSList *l; + + l = g_slist_find (menu->priv->removed_bmks, + GUINT_TO_POINTER (ephy_node_get_id (bmk))); + if (l != NULL) + { + remove_action (l->data, menu->priv->bmk_actions); + + menu->priv->removed_bmks = g_slist_delete_link + (menu->priv->removed_bmks, l); + } + add_action_for_bookmark (menu, bmk); ephy_bookmarks_menu_maybe_update (menu); -- cgit