From 8e878e61d90213c812163e1cf5a56381ff8cb641 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sat, 18 Oct 2003 11:29:17 +0000 Subject: Get rid of the last vestige of ephy_window_update_control(), and make the 2003-10-18 Christian Persch * src/bookmarks/ephy-bookmarks.c: (add_to_favorites), (history_site_visited_cb): * src/ephy-favorites-menu.c: (ephy_favorites_menu_get_type), (ephy_favorites_menu_clean), (ephy_favorites_menu_rebuild), (ephy_favorites_menu_set_property), (ephy_favorites_menu_get_property), (ephy_favorites_menu_class_init), (do_updates), (fav_removed_cb), (fav_added_cb), (ephy_favorites_menu_init), (ephy_favorites_menu_finalize), (ephy_favorites_menu_new): * src/ephy-favorites-menu.h: * src/ephy-window.c: * src/ephy-window.h: Get rid of the last vestige of ephy_window_update_control(), and make the favourites menu self-updating. --- src/bookmarks/ephy-bookmarks.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'src/bookmarks') diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index 9dc4e977e..be3ebe1f9 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -397,7 +397,7 @@ add_to_favorites (EphyBookmarks *eb, EphyNode *node, EphyHistory *eh) url = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_LOCATION); score = get_history_item_score (eh, url); full_menu = ephy_node_get_n_children (eb->priv->favorites) - > MAX_FAVORITES_NUM; + >= MAX_FAVORITES_NUM; if (full_menu && score < eb->priv->lower_score) return FALSE; if (eb->priv->lower_fav && full_menu) @@ -412,23 +412,6 @@ add_to_favorites (EphyBookmarks *eb, EphyNode *node, EphyHistory *eh) return TRUE; } -static void -update_favorites_menus () -{ - Session *session; - const GList *l; - - session = EPHY_SESSION (ephy_shell_get_session (ephy_shell)); - l = session_get_windows (session); - - for (; l != NULL; l = l->next) - { - EphyWindow *window = EPHY_WINDOW (l->data); - - ephy_window_update_control (window, FavoritesControl); - } -} - static void history_site_visited_cb (EphyHistory *gh, const char *url, EphyBookmarks *eb) { @@ -437,10 +420,7 @@ history_site_visited_cb (EphyHistory *gh, const char *url, EphyBookmarks *eb) node = ephy_bookmarks_find_bookmark (eb, url); if (node == NULL) return; - if (add_to_favorites (eb, node, gh)) - { - update_favorites_menus (); - } + add_to_favorites (eb, node, gh); } static void -- cgit v1.2.3