summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-06-02 17:28:12 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-04 07:51:17 +0200
commit26f7b24daa8810d13d0582b8a160a3bf8e5d42c2 (patch)
tree0699a1ce2788119210ac8a1001ab6d5f86ca7720
parent3f0e9bb8f2f938c6e18e09d1b7c567e537dffbd9 (diff)
downloadqtwebkit-26f7b24daa8810d13d0582b8a160a3bf8e5d42c2.tar.gz
CopyLinkToClipboard should copy the URL only
The addition of title information to the dragged or copied links, has caused the clipboard after CopyLinkToClipboard to paste the link title instead of the link URL when doing a simple paste. This paste removes the title from the MimeData so that QMimeData must return the text version of the URL when pasting text. Task-number: QTBUG-39341 Change-Id: Ia28ea0f0eda07a4133c5628b60db624a16ed9931 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
-rw-r--r--Source/WebCore/platform/qt/PasteboardQt.cpp3
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/Source/WebCore/platform/qt/PasteboardQt.cpp b/Source/WebCore/platform/qt/PasteboardQt.cpp
index 7639e2302..1d69398cf 100644
--- a/Source/WebCore/platform/qt/PasteboardQt.cpp
+++ b/Source/WebCore/platform/qt/PasteboardQt.cpp
@@ -208,7 +208,8 @@ void Pasteboard::writeURL(const KURL& url, const String& title, Frame*)
if (!m_writableData)
m_writableData = new QMimeData;
- m_writableData->setText(title);
+ if (!title.isEmpty())
+ m_writableData->setText(title);
m_writableData->setUrls(QList<QUrl>() << url);
if (isForCopyAndPaste())
updateSystemPasteboard();
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
index 13fbe88d3..9f0e7a564 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
@@ -1113,10 +1113,10 @@ void QWebPageAdapter::triggerAction(QWebPageAdapter::MenuAction action, QWebHitT
#if defined(Q_WS_X11)
bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
Pasteboard::generalPasteboard()->setSelectionMode(true);
- editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
+ editor.copyURL(hitTestResult->linkUrl, WTF::String());
Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
#endif
- editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
+ editor.copyURL(hitTestResult->linkUrl, WTF::String());
break;
}
case OpenImageInNewWindow: