┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphintabpage.cpp
diff options
context:
space:
mode:
authorAngelo Oliveira Jr <[email protected]>2019-02-16 16:08:12 +0100
committerElvis Angelaccio <[email protected]>2019-02-16 16:09:27 +0100
commit92368c1e4df9ea09e50c6480c2f72b78416e3244 (patch)
treebceba14535090e8a234340a6234e4523c6451e7b /src/dolphintabpage.cpp
parent037a394ec786d98c358a8c745c68de44efc17f85 (diff)
Add option to choose which view to close
Summary: This Diff make configurable which view will close when toggling off the split view mode, if it's the active one or the inactive one. A new checkbox was added to the Dolphin configuration window, and defaults to the original behavior. FEATURE: 312834 FIXED-IN: 19.03.80 Test Plan: {F6535432} Reviewers: ngraham, #dolphin, elvisangelaccio Reviewed By: ngraham, #dolphin Subscribers: elvisangelaccio, cfeck, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D18040
Diffstat (limited to 'src/dolphintabpage.cpp')
-rw-r--r--src/dolphintabpage.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/dolphintabpage.cpp b/src/dolphintabpage.cpp
index 0193aaad0..e0e9bf4bd 100644
--- a/src/dolphintabpage.cpp
+++ b/src/dolphintabpage.cpp
@@ -88,13 +88,23 @@ void DolphinTabPage::setSplitViewEnabled(bool enabled, const QUrl &secondaryUrl)
m_secondaryViewContainer->show();
m_secondaryViewContainer->setActive(true);
} else {
- // Close the view which is active.
- DolphinViewContainer* view = activeViewContainer();
- if (m_primaryViewActive) {
- // If the primary view is active, we have to swap the pointers
- // because the secondary view will be the new primary view.
- qSwap(m_primaryViewContainer, m_secondaryViewContainer);
- m_primaryViewActive = false;
+ DolphinViewContainer* view;
+ if (GeneralSettings::closeActiveSplitView()) {
+ view = activeViewContainer();
+ if (m_primaryViewActive) {
+ // If the primary view is active, we have to swap the pointers
+ // because the secondary view will be the new primary view.
+ qSwap(m_primaryViewContainer, m_secondaryViewContainer);
+ m_primaryViewActive = false;
+ }
+ } else {
+ view = m_primaryViewActive ? m_secondaryViewContainer : m_primaryViewContainer;
+ if (!m_primaryViewActive) {
+ // If the secondary view is active, we have to swap the pointers
+ // because the secondary view will be the new primary view.
+ qSwap(m_primaryViewContainer, m_secondaryViewContainer);
+ m_primaryViewActive = true;
+ }
}
m_primaryViewContainer->setActive(true);
view->close();