aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--configure.ac2
-rw-r--r--src/bookmarks/ephy-bookmark-action.c23
-rw-r--r--src/bookmarks/ephy-bookmarks.c13
3 files changed, 35 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 2c7fa008d..591ece424 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,7 +86,7 @@ GLIB_REQUIRED=2.35.0
GTK_REQUIRED=3.5.2
LIBXML_REQUIRED=2.6.12
LIBXSLT_REQUIRED=1.1.7
-WEBKIT_GTK_REQUIRED=1.9.6
+WEBKIT_GTK_REQUIRED=1.11.2
LIBSOUP_GNOME_REQUIRED=2.39.6
GNOME_DESKTOP_REQUIRED=2.91.2
GNOME_KEYRING_REQUIRED=2.26.0
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);
}
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index cf2ca9a56..67917bc0e 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -230,6 +230,16 @@ ephy_bookmarks_save_delayed (EphyBookmarks *bookmarks, int delay)
}
}
+#ifdef HAVE_WEBKIT2
+static void
+icon_updated_cb (WebKitFaviconDatabase *favicon_database,
+ const char *address,
+ const char *icon,
+ EphyBookmarks *eb)
+{
+ ephy_bookmarks_set_icon (eb, address, icon);
+}
+#else
static void
icon_updated_cb (WebKitFaviconDatabase *favicon_database,
const char *address,
@@ -241,6 +251,7 @@ icon_updated_cb (WebKitFaviconDatabase *favicon_database,
ephy_bookmarks_set_icon (eb, address, icon);
g_free (icon);
}
+#endif
static void
ephy_setup_history_notifiers (EphyBookmarks *eb)
@@ -249,7 +260,7 @@ ephy_setup_history_notifiers (EphyBookmarks *eb)
#ifdef HAVE_WEBKIT2
favicon_database = webkit_web_context_get_favicon_database (webkit_web_context_get_default ());
- g_signal_connect (favicon_database, "favicon-ready",
+ g_signal_connect (favicon_database, "favicon-changed",
G_CALLBACK (icon_updated_cb), eb);
#else
favicon_database = webkit_get_favicon_database ();