aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmark-action.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2012-12-06 17:34:22 +0800
committerCarlos Garcia Campos <carlosgc@gnome.org>2012-12-07 22:25:55 +0800
commitac8c9be65f62915b8d4e140b90094fa39aae20cc (patch)
tree31e55ee0bcdf81facbb1af201ca9f1933f32c8e2 /src/bookmarks/ephy-bookmark-action.c
parent32a1b250643709abf1c5c598a9d1cf231ffce709 (diff)
downloadgsoc2013-epiphany-ac8c9be65f62915b8d4e140b90094fa39aae20cc.tar
gsoc2013-epiphany-ac8c9be65f62915b8d4e140b90094fa39aae20cc.tar.gz
gsoc2013-epiphany-ac8c9be65f62915b8d4e140b90094fa39aae20cc.tar.bz2
gsoc2013-epiphany-ac8c9be65f62915b8d4e140b90094fa39aae20cc.tar.lz
gsoc2013-epiphany-ac8c9be65f62915b8d4e140b90094fa39aae20cc.tar.xz
gsoc2013-epiphany-ac8c9be65f62915b8d4e140b90094fa39aae20cc.tar.zst
gsoc2013-epiphany-ac8c9be65f62915b8d4e140b90094fa39aae20cc.zip
bookmarks: Use the current favicons API
And bump WebKitGTK+ requirements to make sure we don't use any previous version of the favicons API that was broken. https://bugzilla.gnome.org/show_bug.cgi?id=689762
Diffstat (limited to 'src/bookmarks/ephy-bookmark-action.c')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index a232e7759..472829834 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -67,6 +67,26 @@ typedef struct
G_DEFINE_TYPE (EphyBookmarkAction, ephy_bookmark_action, EPHY_TYPE_LINK_ACTION)
+#ifdef HAVE_WEBKIT2
+static void
+favicon_changed_cb (WebKitFaviconDatabase *database,
+ const char *page_address,
+ const char *icon_address,
+ EphyBookmarkAction *action)
+{
+ const char *icon;
+
+ icon = ephy_node_get_property_string (action->priv->node,
+ EPHY_NODE_BMK_PROP_ICON);
+ if (g_strcmp0 (icon, icon_address) == 0)
+ {
+ g_signal_handler_disconnect (database, action->priv->cache_handler);
+ action->priv->cache_handler = 0;
+
+ g_object_notify (G_OBJECT (action), "icon");
+ }
+}
+#else
static void
favicon_changed_cb (WebKitFaviconDatabase *database,
const char *page_address,
@@ -91,6 +111,7 @@ favicon_changed_cb (WebKitFaviconDatabase *database,
g_free (icon_address);
}
+#endif
static void
async_get_favicon_pixbuf_callback (GObject *source, GAsyncResult *result, gpointer user_data)
@@ -187,7 +208,7 @@ ephy_bookmark_action_sync_icon (GtkAction *action,
{
bma->priv->cache_handler =
g_signal_connect_object
- (database, "favicon-ready",
+ (database, "favicon-changed",
G_CALLBACK (favicon_changed_cb),
action, 0);
}