From d2fa5fd0f5b1972bd372510cc14509e85b972b23 Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Wed, 20 Mar 2019 18:04:50 +0100 Subject: Notification API cleanup Task-number: QTBUG-74543 Change-Id: Ice5a0dbfc3485c8b7e6fa900ef427a9aed871d42 Reviewed-by: Allan Sandfeld Jensen --- src/webenginewidgets/api/qwebengineprofile.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/webenginewidgets/api/qwebengineprofile.cpp') diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index d69ddb343..47b3f4363 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -141,10 +141,12 @@ using QtWebEngineCore::ProfileAdapter; Both session and persistent cookies are saved to and restored from disk. */ -void QWebEngineProfilePrivate::showNotification(QSharedPointer ¬ification) +void QWebEngineProfilePrivate::showNotification(QSharedPointer &controller) { - if (m_notificationPresenter) - m_notificationPresenter(QWebEngineNotification(notification)); + if (m_notificationPresenter) { + std::unique_ptr notification(new QWebEngineNotification(controller)); + m_notificationPresenter(std::move(notification)); + } } /*! @@ -668,7 +670,7 @@ QWebEngineScriptCollection *QWebEngineProfile::scripts() const \since 5.13 \sa QWebEngineNotification */ -void QWebEngineProfile::setNotificationPresenter(std::function notificationPresenter) +void QWebEngineProfile::setNotificationPresenter(std::function)> notificationPresenter) { Q_D(QWebEngineProfile); d->m_notificationPresenter = std::move(notificationPresenter); -- cgit v1.2.3