diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2012-06-22 15:53:30 +0800 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-06-25 23:43:54 +0800 |
commit | 188de2119d0375ac7c27252917778038200210b8 (patch) | |
tree | 7ee7f004435d5c44a93b84f12aa6c562adc60caa | |
parent | b7f905eb4738760f4c1cde4ae2d4154cf7af57ba (diff) | |
download | gsoc2013-epiphany-188de2119d0375ac7c27252917778038200210b8.tar gsoc2013-epiphany-188de2119d0375ac7c27252917778038200210b8.tar.gz gsoc2013-epiphany-188de2119d0375ac7c27252917778038200210b8.tar.bz2 gsoc2013-epiphany-188de2119d0375ac7c27252917778038200210b8.tar.lz gsoc2013-epiphany-188de2119d0375ac7c27252917778038200210b8.tar.xz gsoc2013-epiphany-188de2119d0375ac7c27252917778038200210b8.tar.zst gsoc2013-epiphany-188de2119d0375ac7c27252917778038200210b8.zip |
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.
-rw-r--r-- | embed/ephy-download.c | 16 |
1 files changed, 7 insertions, 9 deletions
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 } /** |