From 03c624f2b2e718ca6164402d55b5dca8c3a819dd Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Mon, 20 Dec 2010 20:48:18 +0100 Subject: - 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 --- src/webview.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/webview.cpp') 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(sender()); -- cgit v1.2.1