From 769f6686195c9cf7fbdbff583462624fe70d756a Mon Sep 17 00:00:00 2001 From: Mario Sanchez Prada Date: Mon, 10 Dec 2012 12:20:53 +0100 Subject: Move async_get_favicon_pixbuf_callback() to a WK2-only region --- src/bookmarks/ephy-bookmark-action.c | 57 +++++++++++++++++------------------- 1 file changed, 27 insertions(+), 30 deletions(-) (limited to 'src/bookmarks') diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index 472829834..0e832c5e1 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -86,32 +86,6 @@ favicon_changed_cb (WebKitFaviconDatabase *database, g_object_notify (G_OBJECT (action), "icon"); } } -#else -static void -favicon_changed_cb (WebKitFaviconDatabase *database, - const char *page_address, - EphyBookmarkAction *action) -{ - const char *icon; - char *icon_address; - - g_return_if_fail (action->priv->node != NULL); - - icon = ephy_node_get_property_string (action->priv->node, - EPHY_NODE_BMK_PROP_ICON); - icon_address = webkit_favicon_database_get_favicon_uri (database, page_address); - - 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"); - } - - g_free (icon_address); -} -#endif static void async_get_favicon_pixbuf_callback (GObject *source, GAsyncResult *result, gpointer user_data) @@ -120,16 +94,12 @@ async_get_favicon_pixbuf_callback (GObject *source, GAsyncResult *result, gpoint WebKitFaviconDatabase *database = WEBKIT_FAVICON_DATABASE (source); GdkPixbuf *pixbuf = NULL; -#ifdef HAVE_WEBKIT2 cairo_surface_t *icon_surface = webkit_favicon_database_get_favicon_finish (database, result, NULL); if (icon_surface) { pixbuf = ephy_pixbuf_get_from_surface_scaled (icon_surface, FAVICON_SIZE, FAVICON_SIZE); cairo_surface_destroy (icon_surface); } -#else - pixbuf = webkit_favicon_database_get_favicon_pixbuf_finish (database, result, NULL); -#endif if (pixbuf) { @@ -151,6 +121,33 @@ async_get_favicon_pixbuf_callback (GObject *source, GAsyncResult *result, gpoint g_object_unref (proxy); } +#else +static void +favicon_changed_cb (WebKitFaviconDatabase *database, + const char *page_address, + EphyBookmarkAction *action) +{ + const char *icon; + char *icon_address; + + g_return_if_fail (action->priv->node != NULL); + + icon = ephy_node_get_property_string (action->priv->node, + EPHY_NODE_BMK_PROP_ICON); + icon_address = webkit_favicon_database_get_favicon_uri (database, page_address); + + 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"); + } + + g_free (icon_address); +} +#endif + static void ephy_bookmark_action_sync_icon (GtkAction *action, GParamSpec *pspec, -- cgit v1.2.3