aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMario Sanchez Prada <msanchez@gnome.org>2012-12-04 20:31:47 +0800
committerMario Sanchez Prada <msanchez@gnome.org>2012-12-04 19:59:20 +0800
commit922083024453e10d90cc9819bd0bc6896636e780 (patch)
tree13b8957bdfd519e8011e41b5fde57b6151c422d4 /src
parent2de3c05a1976ca1c34a356a9416c674212313108 (diff)
downloadgsoc2013-epiphany-922083024453e10d90cc9819bd0bc6896636e780.tar
gsoc2013-epiphany-922083024453e10d90cc9819bd0bc6896636e780.tar.gz
gsoc2013-epiphany-922083024453e10d90cc9819bd0bc6896636e780.tar.bz2
gsoc2013-epiphany-922083024453e10d90cc9819bd0bc6896636e780.tar.lz
gsoc2013-epiphany-922083024453e10d90cc9819bd0bc6896636e780.tar.xz
gsoc2013-epiphany-922083024453e10d90cc9819bd0bc6896636e780.tar.zst
gsoc2013-epiphany-922083024453e10d90cc9819bd0bc6896636e780.zip
Initialize the favicon database from WebKit2GTK+ as soon as possible.
https://bugzilla.gnome.org/show_bug.cgi?id=679370
Diffstat (limited to 'src')
-rw-r--r--src/ephy-shell.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 86b5e0ba0..07075ecbc 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -612,6 +612,12 @@ ephy_shell_init (EphyShell *shell)
{
EphyShell **ptr = &ephy_shell;
+#ifdef HAVE_WEBKIT2
+ WebKitWebContext *web_context;
+ EphyEmbedShellMode mode;
+ char *favicon_db_path;
+#endif
+
shell->priv = EPHY_SHELL_GET_PRIVATE (shell);
/* globally accessible singleton */
@@ -621,9 +627,20 @@ ephy_shell_init (EphyShell *shell)
(gpointer *)ptr);
#ifdef HAVE_WEBKIT2
- g_signal_connect (webkit_web_context_get_default (), "download-started",
+ web_context = webkit_web_context_get_default ();
+ g_signal_connect (web_context, "download-started",
G_CALLBACK (download_started_cb),
shell);
+
+ /* Initialize the favicon cache as early as possible, or further
+ calls to webkit_web_context_get_favicon_database will fail. */
+ mode = ephy_embed_shell_get_mode (ephy_embed_shell_get_default ());
+ favicon_db_path = g_build_filename (mode == EPHY_EMBED_SHELL_MODE_PRIVATE ?
+ ephy_dot_dir () : g_get_user_cache_dir (),
+ g_get_prgname (), "icondatabase", NULL);
+
+ webkit_web_context_set_favicon_database_directory (web_context, favicon_db_path);
+ g_free (favicon_db_path);
#endif
}