summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkstoolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/bookmarkstoolbar.cpp')
-rw-r--r--src/bookmarks/bookmarkstoolbar.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp
index b025aa61..c570622f 100644
--- a/src/bookmarks/bookmarkstoolbar.cpp
+++ b/src/bookmarks/bookmarkstoolbar.cpp
@@ -543,17 +543,30 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event)
int distance = (destPos - m_startDragPos).manhattanLength();
KBookmarkActionInterface *action = dynamic_cast<KBookmarkActionInterface *>(actionAt(destPos));
- if (action && action->bookmark().isGroup())
+ if (action)
{
- if (mouseEvent->button() == Qt::MidButton)
+ if (action->bookmark().isGroup())
{
- BookmarkManager::self()->owner()->openBookmarkFolder(action->bookmark());
+ if (mouseEvent->button() == Qt::MidButton)
+ {
+ BookmarkManager::self()->owner()->loadBookmarkFolder(action->bookmark());
+ }
+ else if (distance < QApplication::startDragDistance())
+ {
+ KBookmarkActionMenu *menu = dynamic_cast<KBookmarkActionMenu *>(actionAt(m_startDragPos));
+ QPoint actionPos = mapToGlobal(widgetForAction(menu)->pos());
+ menu->menu()->popup(QPoint(actionPos.x(), actionPos.y() + widgetForAction(menu)->height()));
+ }
}
- else if (distance < QApplication::startDragDistance())
+ else
{
- KBookmarkActionMenu *menu = dynamic_cast<KBookmarkActionMenu *>(actionAt(m_startDragPos));
- QPoint actionPos = mapToGlobal(widgetForAction(menu)->pos());
- menu->menu()->popup(QPoint(actionPos.x(), actionPos.y() + widgetForAction(menu)->height()));
+ if (!action->bookmark().isNull() && !action->bookmark().isSeparator())
+ {
+ if (mouseEvent->button() == Qt::MidButton)
+ {
+ BookmarkManager::self()->owner()->loadBookmarkInNewTab(action->bookmark());
+ }
+ }
}
}
}