diff options
Diffstat (limited to 'embed')
-rw-r--r-- | embed/ephy-history.c | 29 | ||||
-rw-r--r-- | embed/ephy-history.h | 7 |
2 files changed, 31 insertions, 5 deletions
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); } diff --git a/embed/ephy-history.h b/embed/ephy-history.h index ccddbec67..4308e7adc 100644 --- a/embed/ephy-history.h +++ b/embed/ephy-history.h @@ -44,7 +44,8 @@ enum EPHY_NODE_PAGE_PROP_LAST_VISIT = 5, EPHY_NODE_PAGE_PROP_FIRST_VISIT = 6, EPHY_NODE_PAGE_PROP_HOST_ID = 7, - EPHY_NODE_PAGE_PROP_PRIORITY = 8 + EPHY_NODE_PAGE_PROP_PRIORITY = 8, + EPHY_NODE_PAGE_PROP_ICON = 9 }; struct EphyHistory @@ -86,6 +87,10 @@ void ephy_history_set_page_title (EphyHistory *gh, const char *ephy_history_get_last_page (EphyHistory *gh); +void ephy_history_set_icon (EphyHistory *gh, + const char *url, + const char *icon); + void ephy_history_remove (EphyHistory *gh, EphyNode *node); |