From 3316446cfeb60a10ff5da0c7efd80515034fd9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Tue, 21 Aug 2018 11:30:06 +0200 Subject: WebContentsAdapter: Fix build against Qt 5.9 QTimer::singleShot wants to copy the lambda but LoadURLParams is not copyable. Change-Id: I300b70eef0041294080a15166a50321bb4292cfd Reviewed-by: Allan Sandfeld Jensen --- src/core/web_contents_adapter.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index c7c20c23e..5625695fc 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -638,18 +638,19 @@ void WebContentsAdapter::load(const QWebEngineHttpRequest &request) } } - auto navigate = [this, loadParams = std::move(params)]() { - webContents()->GetController().LoadURLWithParams(loadParams); + auto navigate = [](WebContentsAdapter *adapter, const content::NavigationController::LoadURLParams ¶ms) { + adapter->webContents()->GetController().LoadURLWithParams(params); // Follow chrome::Navigate and invalidate the URL immediately. - m_webContentsDelegate->NavigationStateChanged(webContents(), content::INVALIDATE_TYPE_URL); - focusIfNecessary(); + adapter->m_webContentsDelegate->NavigationStateChanged(adapter->webContents(), content::INVALIDATE_TYPE_URL); + adapter->focusIfNecessary(); }; if (resizeNeeded) { // Schedule navigation on the event loop. - QTimer::singleShot(0, std::move(navigate)); + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, base::BindOnce(navigate, this, std::move(params))); } else { - navigate(); + navigate(this, params); } } -- cgit v1.2.3