aboutsummaryrefslogtreecommitdiffstats
path: root/embed/webkit/webkit-embed.c
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@src.gnome.org>2009-03-26 23:29:18 +0800
committerGustavo Noronha Silva <gns@src.gnome.org>2009-03-26 23:29:18 +0800
commitbd770032b47bdabac773b1158dde0dd9f76d2b20 (patch)
tree6095dd891d63e69949c3bfe8249f9af0967d107b /embed/webkit/webkit-embed.c
parent221a07a2af85385c1541239dd712068fbfb399c1 (diff)
downloadgsoc2013-epiphany-bd770032b47bdabac773b1158dde0dd9f76d2b20.tar
gsoc2013-epiphany-bd770032b47bdabac773b1158dde0dd9f76d2b20.tar.gz
gsoc2013-epiphany-bd770032b47bdabac773b1158dde0dd9f76d2b20.tar.bz2
gsoc2013-epiphany-bd770032b47bdabac773b1158dde0dd9f76d2b20.tar.lz
gsoc2013-epiphany-bd770032b47bdabac773b1158dde0dd9f76d2b20.tar.xz
gsoc2013-epiphany-bd770032b47bdabac773b1158dde0dd9f76d2b20.tar.zst
gsoc2013-epiphany-bd770032b47bdabac773b1158dde0dd9f76d2b20.zip
Use Epiphany's profile directory to store the downloaded file
temporarily, instead of XDG's cache directory. svn path=/trunk/; revision=8939
Diffstat (limited to 'embed/webkit/webkit-embed.c')
-rw-r--r--embed/webkit/webkit-embed.c15
1 files changed, 8 insertions, 7 deletions
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);