Changeset View
Changeset View
Standalone View
Standalone View
src/dolphintabpage.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 80 | if (enabled) { | |||
---|---|---|---|---|---|
83 | 83 | | |||
84 | const bool placesSelectorVisible = m_primaryViewContainer->urlNavigator()->isPlacesSelectorVisible(); | 84 | const bool placesSelectorVisible = m_primaryViewContainer->urlNavigator()->isPlacesSelectorVisible(); | ||
85 | m_secondaryViewContainer->urlNavigator()->setPlacesSelectorVisible(placesSelectorVisible); | 85 | m_secondaryViewContainer->urlNavigator()->setPlacesSelectorVisible(placesSelectorVisible); | ||
86 | 86 | | |||
87 | m_splitter->addWidget(m_secondaryViewContainer); | 87 | m_splitter->addWidget(m_secondaryViewContainer); | ||
88 | m_secondaryViewContainer->show(); | 88 | m_secondaryViewContainer->show(); | ||
89 | m_secondaryViewContainer->setActive(true); | 89 | m_secondaryViewContainer->setActive(true); | ||
90 | } else { | 90 | } else { | ||
91 | // Close the view which is active. | 91 | DolphinViewContainer* view; | ||
92 | DolphinViewContainer* view = activeViewContainer(); | 92 | if (GeneralSettings::closeActiveSplitView()) { | ||
93 | view = activeViewContainer(); | ||||
93 | if (m_primaryViewActive) { | 94 | if (m_primaryViewActive) { | ||
94 | // If the primary view is active, we have to swap the pointers | 95 | // If the primary view is active, we have to swap the pointers | ||
95 | // because the secondary view will be the new primary view. | 96 | // because the secondary view will be the new primary view. | ||
96 | qSwap(m_primaryViewContainer, m_secondaryViewContainer); | 97 | qSwap(m_primaryViewContainer, m_secondaryViewContainer); | ||
97 | m_primaryViewActive = false; | 98 | m_primaryViewActive = false; | ||
98 | } | 99 | } | ||
100 | } else { | ||||
101 | view = m_primaryViewActive ? m_secondaryViewContainer : m_primaryViewContainer; | ||||
102 | if (!m_primaryViewActive) { | ||||
103 | // If the secondary view is active, we have to swap the pointers | ||||
cfeckUnsubmitted Done cfeck: if (...) {
....
} else {
....
}
| |||||
Maybe in this case a ternary ? : is even more readable, but I am not sure of maintainers preference. cfeck: Maybe in this case a ternary ` ? : ` is even more readable, but I am not sure of maintainers… | |||||
104 | // because the secondary view will be the new primary view. | ||||
105 | qSwap(m_primaryViewContainer, m_secondaryViewContainer); | ||||
106 | m_primaryViewActive = true; | ||||
107 | } | ||||
elvisangelaccio: We can just drop this comment | |||||
108 | } | ||||
99 | m_primaryViewContainer->setActive(true); | 109 | m_primaryViewContainer->setActive(true); | ||
100 | view->close(); | 110 | view->close(); | ||
101 | view->deleteLater(); | 111 | view->deleteLater(); | ||
102 | } | 112 | } | ||
103 | } | 113 | } | ||
104 | } | 114 | } | ||
105 | 115 | | |||
106 | DolphinViewContainer* DolphinTabPage::primaryViewContainer() const | 116 | DolphinViewContainer* DolphinTabPage::primaryViewContainer() const | ||
▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines |