Bug 29044 - [GTK] Should update suggested-filename when the response is received
Summary: [GTK] Should update suggested-filename when the response is received
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, Soup
Depends on:
Blocks:
 
Reported: 2009-09-08 12:20 PDT by Gustavo Noronha (kov)
Modified: 2009-09-08 14:02 PDT (History)
0 users

See Also:


Attachments
proposed solution (2.49 KB, patch)
2009-09-08 12:23 PDT, Gustavo Noronha (kov)
xan.lopez: review+
gustavo: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Noronha (kov) 2009-09-08 12:20:11 PDT
When the WebKitDownload object is created with a live Handle, it also has a ResourceResponse object containing the suggested filename. For cases where download is started from scratch, even after the response is received the WebKitDownload's object notion of the suggested filename is not updated.
Comment 1 Gustavo Noronha (kov) 2009-09-08 12:23:13 PDT
Created attachment 39203 [details]
proposed solution
Comment 2 Gustavo Noronha (kov) 2009-09-08 13:03:18 PDT
Will also add this, actually:

diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 3d24598..617ce0b 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -2587,9 +2587,6 @@ void webkit_web_view_request_download(WebKitWebView* webView, WebKitNetworkReque
     else
         download = webkit_download_new(request);
 
-    if (!response.isNull() && !response.suggestedFilename().isEmpty())
-        webkit_download_set_suggested_filename(download, response.suggestedFilename().utf8().data());
-
     gboolean handled;
     g_signal_emit(webView, webkit_web_view_signals[DOWNLOAD_REQUESTED], 0, download, &handled);
Comment 3 Xan Lopez 2009-09-08 13:04:44 PDT
Comment on attachment 39203 [details]
proposed solution

r=me with the change in the comment.
Comment 4 Gustavo Noronha (kov) 2009-09-08 14:02:40 PDT
Landed as r48183.