diff options
| author | Peter Penz <[email protected]> | 2012-04-21 23:27:53 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-04-21 23:29:11 +0200 |
| commit | 007907be20cc63e4c12320b0406cc255286e7792 (patch) | |
| tree | 37651b581aedd0a899cf48e4bda974e4da8ab63f /src/dolphinmainwindow.cpp | |
| parent | e3f46c3b20ed52c7a6ddb9e4762df8b604971339 (diff) | |
Bring back basic bookmark support for the Places Panel
The folders-panel signals have been adjusted too for consistency.
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index a990e2a17..209b10678 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -508,6 +508,12 @@ void DolphinMainWindow::openNewTab(const KUrl& url) } } +void DolphinMainWindow::openNewActivatedTab(const KUrl& url) +{ + openNewTab(url); + m_tabBar->setCurrentIndex(m_viewTab.count() - 1); +} + void DolphinMainWindow::activateNextTab() { if (m_viewTab.count() >= 2) { @@ -1260,16 +1266,6 @@ void DolphinMainWindow::slotTabMoved(int from, int to) m_tabIndex = m_tabBar->currentIndex(); } -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::slotTestCanDecode(const QDragMoveEvent* event, bool& canDecode) { canDecode = KUrl::List::canDecode(event->mimeData()); @@ -1781,8 +1777,10 @@ void DolphinMainWindow::setupDockWidgets() addDockWidget(Qt::LeftDockWidgetArea, foldersDock); connect(this, SIGNAL(urlChanged(KUrl)), foldersPanel, SLOT(setUrl(KUrl))); - connect(foldersPanel, SIGNAL(changeUrl(KUrl,Qt::MouseButtons)), - this, SLOT(handlePlacesClick(KUrl,Qt::MouseButtons))); + connect(foldersPanel, SIGNAL(folderActivated(KUrl)), + this, SLOT(changeUrl(KUrl))); + connect(foldersPanel, SIGNAL(folderMiddleClicked(KUrl)), + this, SLOT(openNewActivatedTab(KUrl))); // Setup "Terminal" #ifndef Q_OS_WIN @@ -1856,8 +1854,10 @@ void DolphinMainWindow::setupDockWidgets() createPanelAction(KIcon("bookmarks"), Qt::Key_F9, placesAction, "show_places_panel"); addDockWidget(Qt::LeftDockWidgetArea, placesDock); - //connect(placesPanel, SIGNAL(urlChanged(KUrl,Qt::MouseButtons)), - // this, SLOT(handlePlacesClick(KUrl,Qt::MouseButtons))); + connect(placesPanel, SIGNAL(placeActivated(KUrl)), + this, SLOT(changeUrl(KUrl))); + connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)), + this, SLOT(openNewActivatedTab(KUrl))); connect(this, SIGNAL(urlChanged(KUrl)), placesPanel, SLOT(setUrl(KUrl))); connect(placesDock, SIGNAL(visibilityChanged(bool)), |
