From 188de2119d0375ac7c27252917778038200210b8 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Fri, 22 Jun 2012 09:53:30 +0200 Subject: ephy-download: Pass suggested filename to define_destination_uri() Instead of getting it from the download to make define_destination_uri() function compatible with WebKit2. --- embed/ephy-download.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'embed') diff --git a/embed/ephy-download.c b/embed/ephy-download.c index 5d77c0e29..756a1e590 100644 --- a/embed/ephy-download.c +++ b/embed/ephy-download.c @@ -281,20 +281,13 @@ parse_extension (const char *filename) } static char * -define_destination_uri (EphyDownload *download) +define_destination_uri (EphyDownload *download, const char *suggested_filename) { char *dest_dir; char *dest_name; char *destination_filename; char *destination_uri; - const char *suggested_filename; -#ifdef HAVE_WEBKIT2 - /* TODO: Downloads */ - suggested_filename = NULL; -#else - suggested_filename = webkit_download_get_suggested_filename (download->priv->download); -#endif dest_dir = ephy_file_get_downloads_dir (); /* Make sure the download directory exists */ @@ -395,14 +388,19 @@ ephy_download_set_destination_uri (EphyDownload *download, void ephy_download_set_auto_destination (EphyDownload *download) { +#ifdef HAVE_WEBKIT2 + /* In WebKit2 priv->destination == NULL means auto_destination */ +#else char *dest; g_return_if_fail (EPHY_IS_DOWNLOAD (download)); - dest = define_destination_uri (download); + dest = define_destination_uri (download, + webkit_download_get_suggested_filename (download->priv->download)); ephy_download_set_destination_uri (download, dest); g_free (dest); +#endif } /** -- cgit v1.2.3