#include <glib/gi18n.h>
+#include <webkit/webkit.h>
+
/**
* SECTION:katze-item
* @short_description: A useful item
if (KATZE_ITEM_IS_FOLDER (item))
image = gtk_image_new_from_stock (GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU);
+ #if WEBKIT_CHECK_VERSION (1, 8, 0)
+ /* FIXME: Don't hard-code icon size */
+ else if ((pixbuf = webkit_favicon_database_try_get_favicon_pixbuf (
+ webkit_get_favicon_database (), item->uri, 16, 16)))
+ image = gtk_image_new_from_pixbuf (pixbuf);
+ #endif
else if ((pixbuf = g_object_get_data (G_OBJECT (item), "pixbuf")))
image = gtk_image_new_from_pixbuf (pixbuf);
else if ((icon = katze_item_get_icon (item)) && !strchr (icon, '/'))
G_CALLBACK (soup_session_settings_notify_first_party_cb), session);
#endif
+ #if WEBKIT_CHECK_VERSION (1, 8, 0)
+ gchar* cache = g_build_filename (g_get_user_data_dir (),
+ "webkit", "icondatabase", NULL);
+ webkit_favicon_database_set_path (webkit_get_favicon_database (), cache);
+ g_free (cache);
+ #endif
+
g_signal_connect (session, "request-queued",
G_CALLBACK (midori_soup_session_settings_accept_language_cb), settings);
"webkit", "icondatabase", NULL);
sokoke_remove_path (cache, TRUE);
g_free (cache);
+ #if WEBKIT_CHECK_VERSION (1, 8, 0)
+ webkit_favicon_database_clear (webkit_get_favicon_database ());
+ #endif
}
static void
g_strfreev (parts);
}
+#if !WEBKIT_CHECK_VERSION (1, 8, 0)
static gboolean
katze_net_icon_status_cb (KatzeNetRequest* request,
MidoriView* view)
pixbuf_scaled = gdk_pixbuf_scale_simple (pixbuf, icon_width, icon_height, GDK_INTERP_BILINEAR);
midori_view_apply_icon (view, pixbuf_scaled, view->icon_uri);
}
+#endif
static void
_midori_web_view_load_icon (MidoriView* view)
{
GdkPixbuf* pixbuf = NULL;
gint icon_width, icon_height;
- GdkPixbuf* pixbuf_scaled;
GtkSettings* settings;
+ #if WEBKIT_CHECK_VERSION (1, 8, 0)
+ settings = gtk_widget_get_settings (view->web_view);
+ gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU,
+ &icon_width, &icon_height);
+ if ((pixbuf = webkit_web_view_try_get_favicon_pixbuf (
+ WEBKIT_WEB_VIEW (view->web_view), 16, 16)))
+ midori_view_apply_icon (view, pixbuf, view->icon_uri);
+ #else
+ GdkPixbuf* pixbuf_scaled;
+
if (!midori_uri_is_http (view->icon_uri))
katze_assign (view->icon_uri, NULL);
pixbuf = pixbuf_scaled;
midori_view_apply_icon (view, pixbuf, view->icon_uri);
}
+ #endif
}
static void