diff options
author | Mario Sanchez Prada <msanchez@gnome.org> | 2012-12-04 20:31:47 +0800 |
---|---|---|
committer | Mario Sanchez Prada <msanchez@gnome.org> | 2012-12-04 19:59:20 +0800 |
commit | 922083024453e10d90cc9819bd0bc6896636e780 (patch) | |
tree | 13b8957bdfd519e8011e41b5fde57b6151c422d4 | |
parent | 2de3c05a1976ca1c34a356a9416c674212313108 (diff) | |
download | gsoc2013-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
-rw-r--r-- | embed/ephy-embed-single.c | 2 | ||||
-rw-r--r-- | src/ephy-shell.c | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c index 1e77c5a04..0c36e502c 100644 --- a/embed/ephy-embed-single.c +++ b/embed/ephy-embed-single.c @@ -417,7 +417,7 @@ ephy_embed_single_initialize (EphyEmbedSingle *single) char *filename; char *cookie_policy; - /* TODO: SoupCache, SSL, favicons */ + /* TODO: SoupCache, SSL */ web_context = webkit_web_context_get_default (); /* Store cookies in moz-compatible SQLite format */ 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 } |