summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-04-04 11:05:21 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-04-04 11:05:21 +0200
commit1c4d0496412eef3e645fad442595016db64d7212 (patch)
tree4c029f025d61cf8c3b0321f434615e0a6ab733e7 /src
parentRemove unused strings (diff)
downloadrekonq-1c4d0496412eef3e645fad442595016db64d7212.tar.xz
Drop plain-text urls on urlbar
Diffstat (limited to 'src')
-rw-r--r--src/urlbar/urlbar.cpp14
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());
}