diff options
author | Johannes Tröscher <fritz_van_tom@hotmail.com> | 2011-09-13 19:45:36 +0200 |
---|---|---|
committer | Johannes Tröscher <fritz_van_tom@hotmail.com> | 2011-09-13 19:45:36 +0200 |
commit | 370bf60c066d678c733d6c689b949a5c7f2527e2 (patch) | |
tree | 0750ddba6a3dc10b62d9e6c6e1721a0e9f175a93 | |
parent | fix layout of rssWidget (diff) | |
download | rekonq-370bf60c066d678c733d6c689b949a5c7f2527e2.tar.xz |
load clipboard url on middle-click if autoscroll is disabled
BUG: 275778 255518
CCBUG: 275778 255518
REVIEW: 102587
REVIEWED-BY: adjam
-rw-r--r-- | src/webview.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index 8dfcc051..3da044ec 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -402,6 +402,23 @@ void WebView::mousePressEvent(QMouseEvent *event) update(); } } + + if (!ReKonfig::autoScroll()) + { + const QString clipboardContent = rApp->clipboard()->text(); + + if (clipboardContent.isEmpty()) + break; + + if (QUrl::fromUserInput(clipboardContent).isValid()) + loadUrl(clipboardContent, Rekonq::CurrentTab); + else // Search with default Engine + { + KService::Ptr defaultEngine = SearchEngine::defaultEngine(); + if (defaultEngine) // check if a default engine is set + loadUrl(KUrl(SearchEngine::buildQuery(defaultEngine, clipboardContent)), Rekonq::CurrentTab); + } + } break; default: |