From: Elvis Angelaccio Date: Sun, 11 Jun 2017 17:33:36 +0000 (+0200) Subject: Merge branch 'Applications/17.04' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/96eff55e75bfd0f1e3f866b4af14f3778e9002b3?hp=-c Merge branch 'Applications/17.04' * Applications/17.04: Change in "Open in new tab" feature in Dolphin Ignore drops-onto-items from invalid places items Revert "Increase smooth scrolling animation duration from 100 to 300 ms and set easing curve to InOutQuart" --- 96eff55e75bfd0f1e3f866b4af14f3778e9002b3 diff --combined src/dolphinmainwindow.cpp index 8d580432f,4b01272b7..3d6f8489d --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@@ -124,7 -124,6 +124,7 @@@ DolphinMainWindow::DolphinMainWindow() setAcceptDrops(true); m_tabWidget = new DolphinTabWidget(this); + m_tabWidget->setObjectName("tabWidget"); connect(m_tabWidget, &DolphinTabWidget::activeViewChanged, this, &DolphinMainWindow::activeViewChanged); connect(m_tabWidget, &DolphinTabWidget::tabCountChanged, @@@ -307,16 -306,21 +307,21 @@@ void DolphinMainWindow::openNewTab(cons void DolphinMainWindow::openInNewTab() { const KFileItemList& list = m_activeViewContainer->view()->selectedItems(); - if (list.isEmpty()) { - openNewTab(m_activeViewContainer->url()); - } else { - foreach (const KFileItem& item, list) { - const QUrl& url = DolphinView::openItemAsFolderUrl(item); - if (!url.isEmpty()) { - openNewTab(url); - } + bool tabCreated = false; + + foreach (const KFileItem& item, list) { + const QUrl& url = DolphinView::openItemAsFolderUrl(item); + if (!url.isEmpty()) { + openNewTab(url); + tabCreated = true; } } + + // if no new tab has been created from the selection + // open the current directory in a new tab + if (!tabCreated) { + openNewTab(m_activeViewContainer->url()); + } } void DolphinMainWindow::openInNewWindow()