aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--embed/ephy-base-embed.c5
-rw-r--r--embed/ephy-history.c16
-rw-r--r--embed/ephy-history.h45
-rw-r--r--src/bookmarks/ephy-bookmarks.c11
4 files changed, 50 insertions, 27 deletions
diff --git a/embed/ephy-base-embed.c b/embed/ephy-base-embed.c
index 2ca7a1490..6b348c394 100644
--- a/embed/ephy-base-embed.c
+++ b/embed/ephy-base-embed.c
@@ -1190,7 +1190,6 @@ ephy_base_embed_set_icon_address (EphyBaseEmbed *embed,
GObject *object = G_OBJECT (embed);
EphyBaseEmbedPrivate *priv = embed->priv;
EphyHistory *history;
- /* EphyBookmarks *eb;*/
g_free (priv->icon_address);
priv->icon_address = g_strdup (address);
@@ -1205,10 +1204,6 @@ ephy_base_embed_set_icon_address (EphyBaseEmbed *embed,
if (priv->icon_address) {
history = EPHY_HISTORY (ephy_embed_shell_get_global_history (embed_shell));
ephy_history_set_icon (history, priv->address, priv->icon_address);
- /*
- eb = ephy_shell_get_bookmarks (ephy_shell);
- ephy_bookmarks_set_icon (eb, priv->address,
- priv->icon_address);*/
ephy_base_embed_load_icon (embed);
}
diff --git a/embed/ephy-history.c b/embed/ephy-history.c
index a59314865..57f4bc0ca 100644
--- a/embed/ephy-history.c
+++ b/embed/ephy-history.c
@@ -84,7 +84,8 @@ enum
VISITED,
CLEARED,
REDIRECT,
- LAST_SIGNAL
+ ICON_UPDATED,
+ LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = { 0 };
@@ -223,6 +224,17 @@ ephy_history_class_init (EphyHistoryClass *klass)
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
+ signals[ICON_UPDATED] =
+ g_signal_new ("icon_updated",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (EphyHistoryClass, icon_updated),
+ NULL, NULL,
+ ephy_marshal_VOID__STRING_STRING,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_STRING, G_TYPE_STRING);
+
g_type_class_add_private (object_class, sizeof (EphyHistoryPrivate));
}
@@ -965,6 +977,8 @@ ephy_history_set_icon (EphyHistory *gh,
ephy_node_set_property_string (host, EPHY_NODE_PAGE_PROP_ICON,
icon);
}
+
+ g_signal_emit (gh, signals[ICON_UPDATED], 0, url, icon);
}
void
diff --git a/embed/ephy-history.h b/embed/ephy-history.h
index a65bd93aa..151ea6394 100644
--- a/embed/ephy-history.h
+++ b/embed/ephy-history.h
@@ -63,60 +63,63 @@ struct _EphyHistory
struct _EphyHistoryClass
{
- GObjectClass parent_class;
+ GObjectClass parent_class;
/* Signals */
- gboolean (* add_page) (EphyHistory *history,
- const char *url,
- gboolean redirect,
- gboolean toplevel);
- void (* visited) (EphyHistory *history,
- const char *url);
- void (* cleared) (EphyHistory *history);
-
- void (* redirect) (EphyHistory *history,
- const char *from_uri,
- const char *to_uri);
+ gboolean (* add_page) (EphyHistory *history,
+ const char *url,
+ gboolean redirect,
+ gboolean toplevel);
+ void (* visited) (EphyHistory *history,
+ const char *url);
+ void (* cleared) (EphyHistory *history);
+
+ void (* redirect) (EphyHistory *history,
+ const char *from_uri,
+ const char *to_uri);
+ void (* icon_updated) (EphyHistory *history,
+ const char *address
+ const char *icon);
};
GType ephy_history_get_type (void);
EphyHistory *ephy_history_new (void);
-EphyNode *ephy_history_get_hosts (EphyHistory *gh);
+EphyNode *ephy_history_get_hosts (EphyHistory *gh);
EphyNode *ephy_history_get_host (EphyHistory *gh,
const char *url);
-EphyNode *ephy_history_get_pages (EphyHistory *gh);
+EphyNode *ephy_history_get_pages (EphyHistory *gh);
-EphyNode *ephy_history_get_page (EphyHistory *gh,
+EphyNode *ephy_history_get_page (EphyHistory *gh,
const char *url);
-void ephy_history_add_page (EphyHistory *gh,
+void ephy_history_add_page (EphyHistory *gh,
const char *url,
gboolean redirect,
gboolean toplevel);
-gboolean ephy_history_is_page_visited (EphyHistory *gh,
+gboolean ephy_history_is_page_visited (EphyHistory *gh,
const char *url);
-int ephy_history_get_page_visits (EphyHistory *gh,
+int ephy_history_get_page_visits (EphyHistory *gh,
const char *url);
-void ephy_history_set_page_title (EphyHistory *gh,
+void ephy_history_set_page_title (EphyHistory *gh,
const char *url,
const char *title);
const char *ephy_history_get_last_page (EphyHistory *gh);
-void ephy_history_set_icon (EphyHistory *gh,
+void ephy_history_set_icon (EphyHistory *gh,
const char *url,
const char *icon);
const char *ephy_history_get_icon (EphyHistory *gh,
const char *url);
-void ephy_history_clear (EphyHistory *gh);
+void ephy_history_clear (EphyHistory *gh);
gboolean ephy_history_is_enabled (EphyHistory *history);
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 097e4cac9..121326874 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -517,6 +517,15 @@ redirect_cb (EphyHistory *history,
}
static void
+icon_updated_cb (EphyHistory *history,
+ const char *address,
+ const char *icon,
+ EphyBookmarks *eb)
+{
+ ephy_bookmarks_set_icon (eb, address, icon);
+}
+
+static void
ephy_setup_history_notifiers (EphyBookmarks *eb)
{
EphyHistory *history;
@@ -534,6 +543,8 @@ ephy_setup_history_notifiers (EphyBookmarks *eb)
G_CALLBACK (history_cleared_cb), eb);
g_signal_connect (history, "redirect",
G_CALLBACK (redirect_cb), eb);
+ g_signal_connect (history, "icon-updated",
+ G_CALLBACK (icon_updated_cb), eb);
}
static void