summaryrefslogtreecommitdiff
path: root/src/webview.cpp
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2010-12-20 20:48:18 +0100
committerYoann Laissus <yoann.laissus@gmail.com>2010-12-20 20:51:10 +0100
commit03c624f2b2e718ca6164402d55b5dca8c3a819dd (patch)
tree426bdbdacdbb79ba59b983cccad74af2cffccabd /src/webview.cpp
parentCtrl+Shift+P shortcut for Private browsing (diff)
downloadrekonq-03c624f2b2e718ca6164402d55b5dca8c3a819dd.tar.xz
- Bookmark folders can now be dragged and dropped in the toolbar.
- Drop a bookmark folder in the WebView no longer crash rekonq but open this folder in new tabs - Fix some crash when a single bookmark is dropped in the WebView (incorrect URL) - Port the drag icon to IconManager CCBUG: 226479
Diffstat (limited to 'src/webview.cpp')
-rw-r--r--src/webview.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/webview.cpp b/src/webview.cpp
index aeaf92b7..2c0b59ea 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -35,6 +35,7 @@
// Local Includes
#include "application.h"
#include "bookmarkprovider.h"
+#include "bookmarkowner.h"
#include "iconmanager.h"
#include "mainview.h"
#include "mainwindow.h"
@@ -453,6 +454,27 @@ void WebView::mouseMoveEvent(QMouseEvent *event)
}
+void WebView::dropEvent(QDropEvent *event)
+{
+ if (event->mimeData()->hasFormat("application/rekonq-bookmark"))
+ {
+ QByteArray addresses = event->mimeData()->data("application/rekonq-bookmark");
+ KBookmark bookmark = Application::bookmarkProvider()->bookmarkManager()->findByAddress(QString::fromLatin1(addresses.data()));
+ if (bookmark.isGroup())
+ {
+ Application::bookmarkProvider()->bookmarkOwner()->openFolderinTabs(bookmark.toGroup());
+ }
+ else
+ {
+ emit loadUrl(bookmark.url(), Rekonq::CurrentTab);
+ }
+ }
+ else
+ {
+ KWebView::dropEvent(event);
+ }
+}
+
void WebView::search()
{
KAction *a = qobject_cast<KAction*>(sender());