From 57e3503e2f7dc2528d7935226d1cd283d8278807 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 11 May 2008 20:14:50 +0000 Subject: If the middle mouse button is pressed above an item of the places panel, open the URL inside a new tab. svn path=/trunk/KDE/kdebase/apps/; revision=806606 --- src/dolphinmainwindow.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index afa6ea43f..149f58b0f 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -763,6 +763,16 @@ void DolphinMainWindow::openTabContextMenu(int index, const QPoint& pos) } } +void DolphinMainWindow::handlePlacesClick(const KUrl& url, Qt::MouseButtons buttons) +{ + if (buttons & Qt::MidButton) { + openNewTab(url); + m_tabBar->setCurrentIndex(m_viewTab.count() - 1); + } else { + changeUrl(url); + } +} + void DolphinMainWindow::init() { DolphinSettings& settings = DolphinSettings::instance(); @@ -1084,8 +1094,8 @@ void DolphinMainWindow::setupDockWidgets() actionCollection()->addAction("show_places_panel", placesDock->toggleViewAction()); addDockWidget(Qt::LeftDockWidgetArea, placesDock); - connect(placesView, SIGNAL(urlChanged(KUrl)), - this, SLOT(changeUrl(KUrl))); + connect(placesView, SIGNAL(urlChanged(KUrl, Qt::MouseButtons)), + this, SLOT(handlePlacesClick(KUrl, Qt::MouseButtons))); connect(this, SIGNAL(urlChanged(KUrl)), placesView, SLOT(setUrl(KUrl))); } -- cgit v1.3