diff options
| author | Alexander Saoutkin <[email protected]> | 2018-10-27 11:23:52 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2018-10-27 11:24:49 +0200 |
| commit | ac118ae1c236bee756593dea91efda6cde6fa634 (patch) | |
| tree | 0fc6aa28088bead0d472d7b7e0da178e57ca4972 | |
| parent | 2278d9ed75e1752de9e190fc3e56c8e488f62a9b (diff) | |
Close Dolphin if last tab closed
Summary:
Allows closing of last tab via shortcut or menubar (File->Close Tab), which then results in closing dolphin.
FEATURE: 397101
Test Plan: [Manual] Check closing tab closes dolphin via shortcut and menubar.
Reviewers: #dolphin, ngraham, #vdg, elvisangelaccio
Reviewed By: #dolphin, ngraham, #vdg, elvisangelaccio
Subscribers: thsurrel, svenmauch, abetts, elvisangelaccio, ngraham, #dolphin, kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D15278
| -rw-r--r-- | src/dolphinmainwindow.cpp | 2 | ||||
| -rw-r--r-- | src/dolphintabwidget.cpp | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index d9adde66b..b14f5289c 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -995,7 +995,6 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer) void DolphinMainWindow::tabCountChanged(int count) { const bool enableTabActions = (count > 1); - actionCollection()->action(KStandardAction::name(KStandardAction::Close))->setEnabled(enableTabActions); actionCollection()->action(QStringLiteral("activate_next_tab"))->setEnabled(enableTabActions); actionCollection()->action(QStringLiteral("activate_prev_tab"))->setEnabled(enableTabActions); } @@ -1048,7 +1047,6 @@ void DolphinMainWindow::setupActions() QAction* closeTab = KStandardAction::close( m_tabWidget, static_cast<void(DolphinTabWidget::*)()>(&DolphinTabWidget::closeTab), actionCollection()); closeTab->setText(i18nc("@action:inmenu File", "Close Tab")); - closeTab->setEnabled(false); KStandardAction::quit(this, &DolphinMainWindow::quit, actionCollection()); diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index edb7247cc..0cbe4529d 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -226,7 +226,8 @@ void DolphinTabWidget::closeTab(const int index) Q_ASSERT(index < count()); if (count() < 2) { - // Never close the last tab. + // Close Dolphin when closing the last tab. + parentWidget()->close(); return; } |
