aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-history.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-19 00:43:54 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-19 00:43:54 +0800
commit4a4d612e4177cb4fc080324f60f57682c408b01a (patch)
tree538b3eae62f84392ea5aa50b29ffe59b2aae1095 /embed/ephy-history.c
parent26d1ed1f62e1c3229729bb79673f1b424a4dd8d9 (diff)
downloadgsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar
gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.gz
gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.bz2
gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.lz
gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.xz
gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.tar.zst
gsoc2013-epiphany-4a4d612e4177cb4fc080324f60f57682c408b01a.zip
Implement clear history. Put favicons near sites names.
2003-04-18 Marco Pesenti Gritti <marco@it.gnome.org> * 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.
Diffstat (limited to 'embed/ephy-history.c')
-rw-r--r--embed/ephy-history.c29
1 files changed, 25 insertions, 4 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);
}