diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-04-04 11:05:21 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-04-04 11:05:21 +0200 |
commit | 1c4d0496412eef3e645fad442595016db64d7212 (patch) | |
tree | 4c029f025d61cf8c3b0321f434615e0a6ab733e7 | |
parent | Remove unused strings (diff) | |
download | rekonq-1c4d0496412eef3e645fad442595016db64d7212.tar.xz |
Drop plain-text urls on urlbar
-rw-r--r-- | src/urlbar/urlbar.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 4d53e175..0a6783af 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -302,6 +302,20 @@ void UrlBar::focusInEvent(QFocusEvent *event) void UrlBar::dropEvent(QDropEvent *event) { + //handles only plain-text with url format + if (event->mimeData()->hasFormat("text/plain") && event->source() != this) + { + QUrl url = QUrl::fromUserInput(event->mimeData()->data("text/plain")); + + if (url.isValid()) + { + setQUrl(url); + activated(text()); + return; + } + } + + //handles everything else KLineEdit::dropEvent(event); activated(text()); } |