┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index e28e540d1..4b01272b7 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -306,16 +306,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()