From 4a4d612e4177cb4fc080324f60f57682c408b01a Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 18 Apr 2003 16:43:54 +0000 Subject: Implement clear history. Put favicons near sites names. 2003-04-18 Marco Pesenti Gritti * embed/ephy-history.c: (ephy_history_set_page_title), (ephy_history_set_icon), (ephy_history_clear): * embed/ephy-history.h: * src/ephy-history-window.c: (cmd_clear), (provide_favicon), (ephy_history_window_construct): * src/ephy-tab.c: (ephy_tab_set_favicon): Implement clear history. Put favicons near sites names. --- embed/ephy-history.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'embed/ephy-history.c') diff --git a/embed/ephy-history.c b/embed/ephy-history.c index 3bb69db7f..51dd68936 100644 --- a/embed/ephy-history.c +++ b/embed/ephy-history.c @@ -758,11 +758,12 @@ ephy_history_set_page_title (EphyHistory *gh, const char *title) { EphyNode *node; - guint host_id; GValue value = { 0, }; LOG ("Set page title") + if (title == NULL || title[0] == '\0') return; + node = ephy_history_get_page (gh, url); if (!node) return; @@ -771,9 +772,28 @@ ephy_history_set_page_title (EphyHistory *gh, ephy_node_set_property (node, EPHY_NODE_PAGE_PROP_TITLE, &value); g_value_unset (&value); +} + +void +ephy_history_set_icon (EphyHistory *gh, + const char *url, + const char *icon) +{ + EphyNode *host; + + LOG ("Set host icon") - host_id = ephy_node_get_property_int - (node, EPHY_NODE_PAGE_PROP_HOST_ID); + host = g_hash_table_lookup (gh->priv->hosts_hash, url); + if (host) + { + GValue value = { 0, }; + + g_value_init (&value, G_TYPE_STRING); + g_value_set_string (&value, icon); + ephy_node_set_property + (host, EPHY_NODE_PAGE_PROP_ICON, &value); + g_value_unset (&value); + } } void @@ -786,7 +806,8 @@ ephy_history_clear (EphyHistory *gh) ephy_node_unref (node); } - while ((node = ephy_node_get_nth_child (gh->priv->hosts, 0)) != NULL) + /* The first node is All, dont unref it */ + while ((node = ephy_node_get_nth_child (gh->priv->hosts, 1)) != NULL) { ephy_node_unref (node); } -- cgit v1.2.3