diff options
author | Gustavo Noronha Silva <gns@gnome.org> | 2009-12-18 20:17:25 +0800 |
---|---|---|
committer | Gustavo Noronha Silva <gns@gnome.org> | 2009-12-18 20:17:25 +0800 |
commit | b6102135d673197eecdc6497d6153d00f6b75301 (patch) | |
tree | 5b322f4366a7abde6a9b73285e215f47058f84bb /embed/ephy-embed.c | |
parent | b46e4176e430872a3d47d0b41d0694a2ea121c5e (diff) | |
download | gsoc2013-epiphany-b6102135d673197eecdc6497d6153d00f6b75301.tar.gz gsoc2013-epiphany-b6102135d673197eecdc6497d6153d00f6b75301.tar.zst gsoc2013-epiphany-b6102135d673197eecdc6497d6153d00f6b75301.zip |
Restore download on shift-click functionality
Diffstat (limited to 'embed/ephy-embed.c')
-rw-r--r-- | embed/ephy-embed.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 95b630c63..3b1e7c03a 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -563,7 +563,7 @@ define_destination_uri (WebKitDownload *download, return TRUE; } -static void +static gboolean perform_auto_download (WebKitDownload *download) { DownloaderView *dview; @@ -571,13 +571,29 @@ perform_auto_download (WebKitDownload *download) if (!define_destination_uri (download, FALSE)) { webkit_download_cancel (download); ephy_file_delete_uri (webkit_download_get_destination_uri (download)); - return; + return FALSE; } dview = EPHY_DOWNLOADER_VIEW (ephy_embed_shell_get_downloader_view (embed_shell)); g_object_set_data (G_OBJECT(download), "download-action", GINT_TO_POINTER(DOWNLOAD_ACTION_OPEN)); downloader_view_add_download (dview, download); + + return TRUE; +} + +void +ephy_embed_auto_download_url (EphyEmbed *embed, const char *url) +{ + WebKitNetworkRequest *request; + WebKitDownload *download; + + request = webkit_network_request_new (url); + download = webkit_download_new (request); + g_object_unref (request); + + if (perform_auto_download (download)) + webkit_download_start (download); } static void |