aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMario Sanchez Prada <mario@mariospr.org>2012-12-10 19:20:53 +0800
committerMario Sanchez Prada <mario@mariospr.org>2012-12-10 19:21:28 +0800
commit769f6686195c9cf7fbdbff583462624fe70d756a (patch)
treeab3266676014dd04f87047efc808622c1300ade0 /src
parent3f3006086e5e0322e7e1b05fc2cdc23df8cf0002 (diff)
downloadgsoc2013-epiphany-769f6686195c9cf7fbdbff583462624fe70d756a.tar
gsoc2013-epiphany-769f6686195c9cf7fbdbff583462624fe70d756a.tar.gz
gsoc2013-epiphany-769f6686195c9cf7fbdbff583462624fe70d756a.tar.bz2
gsoc2013-epiphany-769f6686195c9cf7fbdbff583462624fe70d756a.tar.lz
gsoc2013-epiphany-769f6686195c9cf7fbdbff583462624fe70d756a.tar.xz
gsoc2013-epiphany-769f6686195c9cf7fbdbff583462624fe70d756a.tar.zst
gsoc2013-epiphany-769f6686195c9cf7fbdbff583462624fe70d756a.zip
Move async_get_favicon_pixbuf_callback() to a WK2-only region
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c57
1 files changed, 27 insertions, 30 deletions
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,