diff options
| author | Peter Penz <[email protected]> | 2008-05-11 20:14:50 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-05-11 20:14:50 +0000 |
| commit | 57e3503e2f7dc2528d7935226d1cd283d8278807 (patch) | |
| tree | f5b6d8bdbe7402e719391c2595fd43deb5451bfa /src/dolphinmainwindow.cpp | |
| parent | 2ad91b45342ddd49854ae2b31a9c6cada1ad1c4e (diff) | |
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
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
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))); } |
