summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-10-08 13:57:17 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-10-08 14:59:57 +0000
commit8987ca00bd1f1a3ea82f3a9f1348343db3aa38b2 (patch)
treec030bf6803c6d3063063f4f6480a70826d0ebeb8 /src
parent0228a5bd581ae6d672ce5f39f11d6205a8bd8aaf (diff)
parent71728d12a21852282107ed463e5359c17e37f151 (diff)
Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6
Diffstat (limited to 'src')
-rw-r--r--src/core/download_manager_delegate_qt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index c01dcf63d..e9af98fd8 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -40,6 +40,7 @@
#include "content/public/browser/download_item.h"
#include "content/public/browser/save_page_type.h"
#include "content/public/browser/web_contents.h"
+#include "net/http/http_content_disposition.h"
#include <QDir>
#include <QFile>
@@ -104,6 +105,9 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(content::DownloadItem* i
std::string suggestedFilename = item->GetSuggestedFilename();
if (suggestedFilename.empty())
+ suggestedFilename = net::HttpContentDisposition(item->GetContentDisposition(), std::string()).filename();
+
+ if (suggestedFilename.empty())
suggestedFilename = item->GetTargetFilePath().AsUTF8Unsafe();
if (suggestedFilename.empty())