summaryrefslogtreecommitdiff
path: root/katze/midori-paths.vala
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2012-12-07 20:18:26 +0100
committerChristian Dywan <christian@twotoasts.de>2012-12-07 20:18:26 +0100
commitfdeac136a7b49dee71adb2f95ecf471deefeffe4 (patch)
treef08b7ce40b73ab8e3514b21d57e7c1bb899e6489 /katze/midori-paths.vala
parentc03b37461ee62620187dbde5c5f53b992a87a508 (diff)
downloadmidori-fdeac136a7b49dee71adb2f95ecf471deefeffe4.tar.gz
Move icon path setup and clearing into Midori.Paths
Diffstat (limited to 'katze/midori-paths.vala')
-rw-r--r--katze/midori-paths.vala15
1 files changed, 15 insertions, 0 deletions
diff --git a/katze/midori-paths.vala b/katze/midori-paths.vala
index 6c1ed41e..2f62a909 100644
--- a/katze/midori-paths.vala
+++ b/katze/midori-paths.vala
@@ -116,6 +116,10 @@ namespace Midori {
tmp_dir = Path.build_path (Path.DIR_SEPARATOR_S,
Environment.get_tmp_dir (), "midori-" + Environment.get_user_name ());
}
+#if HAVE_WEBKIT_1_8_0
+ if (user_data_dir != null)
+ WebKit.get_favicon_database ().set_path (Path.build_filename (user_data_dir, "webkit", "icondatabase"));
+#endif
if (strcmp (Environment.get_variable ("MIDORI_DEBUG"), "paths") == 0) {
stdout.printf ("config: %s\ncache: %s\nuser_data: %s\ntmp: %s\n",
config_dir, cache_dir, user_data_dir, tmp_dir);
@@ -364,6 +368,17 @@ namespace Midori {
#endif
}
+ public static void clear_icons () {
+ assert (cache_dir != null);
+ assert (user_data_dir != null);
+#if HAVE_WEBKIT_1_8_0
+ WebKit.get_favicon_database ().clear ();
+#endif
+ /* FIXME: Exclude search engine icons */
+ remove_path (Path.build_filename (cache_dir, "icons"));
+ remove_path (Path.build_filename (user_data_dir, "webkit", "icondatabase"));
+ }
+
public static Gdk.Pixbuf? get_icon (string? uri, Gtk.Widget? widget) {
if (!Midori.URI.is_resource (uri))
return null;