aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c23
-rw-r--r--src/bookmarks/ephy-bookmarks.c13
2 files changed, 34 insertions, 2 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);
}
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 ();