diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-08 15:48:07 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-08 15:48:07 +0200 |
commit | 71728d12a21852282107ed463e5359c17e37f151 (patch) | |
tree | 883660a4db4405154d52dafab8ca3d8c8bac2f4a | |
parent | f681793c6895d390fe7a5f57718e25a4fcd10ed0 (diff) | |
parent | a907edc50641ddc634934747ad3c158d05dc7361 (diff) |
Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: I1ac58ada3f32821d62d49e5fcb12546aa9e75fb4
-rw-r--r-- | src/core/download_manager_delegate_qt.cpp | 4 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/functions.prf | 17 |
2 files changed, 16 insertions, 5 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()) diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index c0e1f90bb..421513727 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -22,11 +22,18 @@ defineTest(isPlatformSupported) { } defineTest(isPythonVersionSupported) { - python_major_version = $$system('python -c "import sys; print sys.version_info.major"') - python_minor_version = $$system('python -c "import sys; print sys.version_info.minor"') - lessThan(python_major_version, 3): greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): return(true) - skipBuild("Using Python version "$$python_major_version"."$$python_minor_version", but Python version 2 (2.7 or later) is required to build Qt WebEngine.") - return(false) + python_error_msg = "Python version 2 (2.7 or later) is required to build Qt WebEngine." + python_major_version = $$system('python -c "import sys; print(sys.version_info[0])"') + greaterThan(python_major_version, 2) { + skipBuild("Python version 3 is not supported by Chromium.") + skipBuild($$python_error_msg) + return(false) + } + python_minor_version = $$system('python -c "import sys; print(sys.version_info[1])"') + greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): return(true) + skipBuild("Using Python version "$$python_major_version"."$$python_minor_version".") + skipBuild($$python_error_msg) + return(false) } defineTest(isGCCVersionSupported) { |