]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'Applications/17.04'
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 11 Jun 2017 17:33:36 +0000 (19:33 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 11 Jun 2017 17:33:36 +0000 (19:33 +0200)
* 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"

1  2 
src/dolphinmainwindow.cpp

index 8d580432f76f6a631fcf29b6e6c94bfd0ec2376c,4b01272b7e2a372b7735b48f5afb3508a2a21d04..3d6f8489defecc2976509393a54e85c51b23f29d
@@@ -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()