[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/libs/webkitkde/kdewebkit
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2009-11-03 0:45:07
Message-ID: 1257209107.682324.24466.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1044091 by adawit:

Prevent navigation to url from the selection clipboard if a middle click
occurs on editable element such as a form element even if it does not
currently have focus...

For KDE 4.4 and above, which comes with QtWebKit 4.6, the text from the
clipboard should properly get pasted into form elements without focus
thanks to the new QWebElement class. [Untested]

See kdereview/kdewebkit/kwebviewprivate_p.h.

BUG:212821


 M  +2 -3      kwebview.cpp  


--- trunk/playground/libs/webkitkde/kdewebkit/kwebview.cpp #1044090:1044091
@@ -99,8 +99,7 @@
 }
 
 void KWebView::mouseReleaseEvent(QMouseEvent *event)
-{  
-
+{
     const QWebHitTestResult result = page()->mainFrame()->hitTestContent(event->pos());
     const QUrl url = result.linkUrl();
 
@@ -124,7 +123,7 @@
 
     if (!event->isAccepted()) {
         // Navigate to url in clipboard on middle mouse button click on the page...
-        if (!isModified() && (d->pressedButtons & Qt::MidButton)) {
+        if (!isModified() && !result.isContentEditable() && (d->pressedButtons & Qt::MidButton)) {
             QString clipboardText(QApplication::clipboard()->text(QClipboard::Selection).trimmed());
             if (KUriFilter::self()->filterUri(clipboardText, QStringList() << "kshorturifilter")) {
                 kDebug() << "Navigating to" << clipboardText;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic