diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-20 16:54:17 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-20 16:54:42 +0100 |
commit | 8a1fadd42dafb8abc54b7e9529f7db1200c643fa (patch) | |
tree | 2975b1546452d2a17fa4a7a4fe4e3ba2e327c591 | |
parent | 1173d48149a8133b607894b67e1ec32de68e21e8 (diff) | |
parent | 5a8bae70bb6caf01c262ed3a607c736ea72561b9 (diff) |
Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: I20e36d0e18dd26365557a4093436e9660e30e173
-rw-r--r-- | examples/webenginewidgets/demobrowser/downloadmanager.cpp | 2 | ||||
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 1 | ||||
-rw-r--r-- | src/webengine/api/qquickwebenginescript.cpp | 3 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/functions.prf | 31 |
4 files changed, 26 insertions, 11 deletions
diff --git a/examples/webenginewidgets/demobrowser/downloadmanager.cpp b/examples/webenginewidgets/demobrowser/downloadmanager.cpp index eab28942e..1c33f12c7 100644 --- a/examples/webenginewidgets/demobrowser/downloadmanager.cpp +++ b/examples/webenginewidgets/demobrowser/downloadmanager.cpp @@ -149,7 +149,7 @@ void DownloadWidget::stop() void DownloadWidget::open() { - QUrl url = QUrl::fromLocalFile(m_file.absolutePath()); + QUrl url = QUrl::fromLocalFile(m_file.absoluteFilePath()); QDesktopServices::openUrl(url); } diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 1897664e3..59fa0a9a8 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -105,6 +105,7 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents load_url_params.extra_headers = params.extra_headers; load_url_params.should_replace_current_entry = params.should_replace_current_entry; load_url_params.is_renderer_initiated = params.is_renderer_initiated; + load_url_params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE; if (params.transferred_global_request_id != content::GlobalRequestID()) load_url_params.transferred_global_request_id = params.transferred_global_request_id; diff --git a/src/webengine/api/qquickwebenginescript.cpp b/src/webengine/api/qquickwebenginescript.cpp index affffbf46..71dad701f 100644 --- a/src/webengine/api/qquickwebenginescript.cpp +++ b/src/webengine/api/qquickwebenginescript.cpp @@ -37,6 +37,7 @@ #include "qquickwebenginescript_p.h" #include "qquickwebenginescript_p_p.h" +#include <QQmlFile> #include <QtCore/QDebug> #include <QtCore/QFile> #include <QtCore/QStringBuilder> @@ -178,7 +179,7 @@ void QQuickWebEngineScript::setSourceUrl(QUrl arg) d->m_sourceUrl = arg; Q_EMIT sourceUrlChanged(d->m_sourceUrl); - QFile f(arg.toLocalFile()); + QFile f(QQmlFile::urlToLocalFileOrQrc(arg)); if (!f.open(QIODevice::ReadOnly)) { qWarning() << "Can't open user script " << arg; return; diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index d5265ab00..2c75f4984 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -163,17 +163,30 @@ defineTest(use?) { } defineReplace(findOrBuildNinja) { - # If NINJA_PATH env var is set, prefer that. - # Fallback to locating our own bootstrapped ninja. - out = $(NINJA_PATH) - !exists($$out) { - out = $$absolute_path("$${getChromiumSrcDir()}/../ninja/ninja", "$$QTWEBENGINE_ROOT") - win32: out = $$system_path($${out}.exe) + # If NINJA_PATH env var is set, prefer that. + # Fallback to locating our own bootstrapped ninja. + out = $(NINJA_PATH) + !exists($$out) { + src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") + + out = $$shadowed($$absolute_path("ninja/ninja", "$$src_3rd_party_dir")) + win32: out = $${out}.exe - # If we did not find ninja, then we bootstrap it. - !exists($$out): system("cd $$dirname(out) && python configure.py --bootstrap") + out = $$system_path($$out) + # If we did not find ninja, then we bootstrap it. + !exists($$out) { + # If we are making a shadow build, copy the ninja sources to the build directory. + !equals(PWD, $${OUT_PWD}) { + log("Build directory is different from source directory - copying ninja sources to the build tree...") + shadow_3rd_party_path = $$system_path($$shadowed($$src_3rd_party_dir)) + + !exists($$dirname(out)): mkpath($$shadow_3rd_party_path) + system("$$QMAKE_COPY_DIR $$system_quote($$system_path($$absolute_path("ninja", "$$src_3rd_party_dir"))) $$system_quote($$shadow_3rd_party_path)") + } + system("cd $$system_quote($$dirname(out)) && python configure.py --bootstrap") } - return($$out) + } + return($$out) } defineTest(skipBuild) { |