diff options
| author | Elvis Angelaccio <[email protected]> | 2017-06-11 19:33:36 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2017-06-11 19:33:36 +0200 |
| commit | 96eff55e75bfd0f1e3f866b4af14f3778e9002b3 (patch) | |
| tree | 22fe4883d7925aa7c919a6364a0d84ee78aea1e4 /src/dolphinmainwindow.cpp | |
| parent | a2f9e005a5e281b5c4938e86b4a5a85ede63c4b9 (diff) | |
| parent | ec9f4ed17c9c71078eac838060024aef5ca8b2c3 (diff) | |
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"
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 8d580432f..3d6f8489d 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -307,16 +307,21 @@ void DolphinMainWindow::openNewTab(const QUrl& url) 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() |
