From bd770032b47bdabac773b1158dde0dd9f76d2b20 Mon Sep 17 00:00:00 2001 From: Gustavo Noronha Silva Date: Thu, 26 Mar 2009 15:29:18 +0000 Subject: Use Epiphany's profile directory to store the downloaded file temporarily, instead of XDG's cache directory. svn path=/trunk/; revision=8939 --- embed/webkit/webkit-embed.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'embed/webkit/webkit-embed.c') diff --git a/embed/webkit/webkit-embed.c b/embed/webkit/webkit-embed.c index 227c34d05..cd1d1b11a 100644 --- a/embed/webkit/webkit-embed.c +++ b/embed/webkit/webkit-embed.c @@ -27,6 +27,7 @@ #include "ephy-command-manager.h" #include "ephy-debug.h" #include "ephy-file-chooser.h" +#include "ephy-file-helpers.h" #include "ephy-history.h" #include "ephy-embed-factory.h" #include "ephy-embed-shell.h" @@ -438,18 +439,18 @@ download_requested_cb (WebKitWebView *web_view, EphyFileChooser *dialog; GtkWidget *window; - char *cache_dir; + char *tmp_dir; const char *suggested_filename; char *tmp_filename; char *destination_uri; /* Make sure the cache directory exists */ - cache_dir = g_build_filename (g_get_user_cache_dir (), "Epiphany", NULL); + tmp_dir = g_build_filename (ephy_dot_dir (), "downloads", NULL); - if (g_mkdir_with_parents (cache_dir, 0700) == -1) { + if (g_mkdir_with_parents (tmp_dir, 0700) == -1) { g_critical ("Could not create temporary directory \"%s\": %s", - cache_dir, strerror (errno)); - g_free (cache_dir); + tmp_dir, strerror (errno)); + g_free (tmp_dir); return FALSE; } @@ -457,12 +458,12 @@ download_requested_cb (WebKitWebView *web_view, * for the location to where the file must go. */ suggested_filename = webkit_download_get_suggested_filename (download); - tmp_filename = g_build_filename (cache_dir, suggested_filename, NULL); + tmp_filename = g_build_filename (tmp_dir, suggested_filename, NULL); destination_uri = g_strconcat ("file://", tmp_filename, NULL); webkit_download_set_destination_uri (download, destination_uri); - g_free (cache_dir); + g_free (tmp_dir); g_free (tmp_filename); g_free (destination_uri); -- cgit v1.2.3