Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1
kwebkitpart
0002-Copy-only-the-email-address-and-not-the-ma...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-Copy-only-the-email-address-and-not-the-mailto-link.patch of Package kwebkitpart
From 4d9b3e743991abfe61f8bff1af5d120516914588 Mon Sep 17 00:00:00 2001 From: Dawit Alemayehu <adawit@kde.org> Date: Sun, 18 May 2014 03:10:10 -0400 Subject: [PATCH 4/5] Copy only the email address and not the mailto link. BUG: 334961 FIXED-IN: 1.3.4 --- src/kwebkitpart_ext.cpp | 10 ++++++++++ src/kwebkitpart_ext.h | 1 + src/webview.cpp | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/kwebkitpart_ext.cpp b/src/kwebkitpart_ext.cpp index 19c4f5d..226f875 100644 --- a/src/kwebkitpart_ext.cpp +++ b/src/kwebkitpart_ext.cpp @@ -520,6 +520,16 @@ void WebKitBrowserExtension::slotCopyLinkText() } } +void WebKitBrowserExtension::slotCopyEmailAddress() +{ + if (view()) { + QMimeData* data = new QMimeData; + const QUrl url (view()->contextMenuResult().linkUrl()); + data->setText(url.path()); + QApplication::clipboard()->setMimeData(data, QClipboard::Clipboard); + } +} + void WebKitBrowserExtension::slotSaveLinkAs() { if (view()) diff --git a/src/kwebkitpart_ext.h b/src/kwebkitpart_ext.h index 4e0828c..fe57c2f 100644 --- a/src/kwebkitpart_ext.h +++ b/src/kwebkitpart_ext.h @@ -85,6 +85,7 @@ public Q_SLOTS: void slotCopyLinkURL(); void slotCopyLinkText(); void slotSaveLinkAs(); + void slotCopyEmailAddress(); void slotViewDocumentSource(); void slotViewFrameSource(); diff --git a/src/webview.cpp b/src/webview.cpp index b6ba0e8..de03464 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -684,7 +684,7 @@ void WebView::linkActionPopupMenu(KParts::BrowserExtension::ActionGroupMap& link if (url.protocol() == "mailto") { action = new KAction(i18n("&Copy Email Address"), this); m_actionCollection->addAction(QL1S("copylinklocation"), action); - connect(action, SIGNAL(triggered(bool)), m_part->browserExtension(), SLOT(slotCopyLinkURL())); + connect(action, SIGNAL(triggered(bool)), m_part->browserExtension(), SLOT(slotCopyEmailAddress())); linkActions.append(action); } else { if (!m_result.isContentSelected()) { @@ -1033,4 +1033,4 @@ void WebView::makeAccessKeyLabel(const QChar &accessKey, const QWebElement &elem label->move(point); m_accessKeyLabels.append(label); m_accessKeyNodes.insertMulti(accessKey, element); -} \ No newline at end of file +} -- 1.9.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor