From 50b8ba645ee1c1d21d9b3e9a65c8d9f7bd1ef359 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Tue, 1 Mar 2016 08:54:08 +0100 Subject: [PATCH] Adapt to new api --- CMakeLists.txt | 2 +- .../src/articleviewer-ng/webengine/articleviewerwebengine.cpp | 8 +++++--- akregator/src/frame/webengine/webengineviewer.cpp | 8 +++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63384efb9c..bdd9d138c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,7 @@ set(LIBGRAVATAR_VERSION_LIB "5.1.41") set(LIBMAILIMPORTER_VERSION_LIB "5.1.41") set(MAILCOMMON_LIB_VERSION_LIB "5.1.41") set(KDEPIM_APPS_LIB_VERSION_LIB "5.1.42") -set(MESSAGELIB_LIB_VERSION_LIB "5.1.75") +set(MESSAGELIB_LIB_VERSION_LIB "5.1.76") set(LIBKLEO_LIB_VERSION_LIB "5.1.41") set(LIBGRANTLEETHEME_LIB_VERSION_LIB "5.1.41") set(PIMCOMMON_LIB_VERSION_LIB "5.1.55") diff --git a/akregator/src/articleviewer-ng/webengine/articleviewerwebengine.cpp b/akregator/src/articleviewer-ng/webengine/articleviewerwebengine.cpp index 210dd4d2e4..da77db43ef 100644 --- a/akregator/src/articleviewer-ng/webengine/articleviewerwebengine.cpp +++ b/akregator/src/articleviewer-ng/webengine/articleviewerwebengine.cpp @@ -201,9 +201,10 @@ void ArticleViewerWebEngine::slotLoadStarted() void ArticleViewerWebEngine::displayContextMenu(const QPoint &pos) { - const MessageViewer::WebHitTestResult webHit = mPageEngine->hitTestContent(pos); - mCurrentUrl = webHit.linkUrl(); + MessageViewer::WebHitTestResult *webHit = mPageEngine->hitTestContent(pos); + mCurrentUrl = webHit->linkUrl(); if (URLHandlerWebEngineManager::instance()->handleContextMenuRequest(mCurrentUrl, mapToGlobal(pos), this)) { + delete webHit; return; } @@ -215,7 +216,7 @@ void ArticleViewerWebEngine::displayContextMenu(const QPoint &pos) popup.addSeparator(); popup.addAction(mActionCollection->action(QStringLiteral("savelinkas"))); popup.addAction(mActionCollection->action(QStringLiteral("copylinkaddress"))); - if (!webHit.imageUrl().isEmpty()) { + if (!webHit->imageUrl().isEmpty()) { popup.addSeparator(); popup.addAction(mActionCollection->action(QStringLiteral("copy_image_location"))); popup.addAction(mActionCollection->action(QStringLiteral("saveas_imageurl"))); @@ -244,6 +245,7 @@ void ArticleViewerWebEngine::displayContextMenu(const QPoint &pos) popup.addAction(ActionManager::getInstance()->action(QStringLiteral("speak_text"))); } popup.exec(mapToGlobal(pos)); + delete webHit; } void ArticleViewerWebEngine::slotLinkHovered(const QString &link) diff --git a/akregator/src/frame/webengine/webengineviewer.cpp b/akregator/src/frame/webengine/webengineviewer.cpp index c943bba1d7..ce42f9a28c 100644 --- a/akregator/src/frame/webengine/webengineviewer.cpp +++ b/akregator/src/frame/webengine/webengineviewer.cpp @@ -58,9 +58,10 @@ void WebEngineViewer::contextMenuEvent(QContextMenuEvent *e) void WebEngineViewer::displayContextMenu(const QPoint &pos) { - const MessageViewer::WebHitTestResult webHit = mPageEngine->hitTestContent(pos); - mCurrentUrl = webHit.linkUrl(); + MessageViewer::WebHitTestResult *webHit = mPageEngine->hitTestContent(pos); + mCurrentUrl = webHit->linkUrl(); if (URLHandlerWebEngineManager::instance()->handleContextMenuRequest(mCurrentUrl, mapToGlobal(pos), this)) { + delete webHit; return; } QMenu popup(this); @@ -90,7 +91,7 @@ void WebEngineViewer::displayContextMenu(const QPoint &pos) popup.addSeparator(); popup.addAction(mActionCollection->action(QStringLiteral("savelinkas"))); popup.addAction(mActionCollection->action(QStringLiteral("copylinkaddress"))); - if (!webHit.imageUrl().isEmpty()) { + if (!webHit->imageUrl().isEmpty()) { popup.addSeparator(); popup.addAction(mActionCollection->action(QStringLiteral("copy_image_location"))); popup.addAction(mActionCollection->action(QStringLiteral("saveas_imageurl"))); @@ -121,6 +122,7 @@ void WebEngineViewer::displayContextMenu(const QPoint &pos) popup.addAction(ActionManager::getInstance()->action(QStringLiteral("speak_text"))); } popup.exec(mapToGlobal(pos)); + delete webHit; } void WebEngineViewer::slotOpenBlockableItemsDialog() -- 2.11.4.GIT