Commit fa8d9de4 authored by Eugene Popov's avatar Eugene Popov Committed by Nate Graham
Browse files

Fix closing a secondary viewContainer on startup settings change

Apply split view settings only when changing the corresponding option.

BUG: 426221
FIXED-IN: 21.08.2
parent 8bf64cf8
......@@ -216,6 +216,9 @@ DolphinMainWindow::DolphinMainWindow() :
showErrorMessage(errorMessage);
});
#endif
connect(GeneralSettings::self(), &GeneralSettings::splitViewChanged,
this, &DolphinMainWindow::slotSplitViewChanged);
}
DolphinMainWindow::~DolphinMainWindow()
......@@ -439,6 +442,12 @@ void DolphinMainWindow::openNewTab(const QUrl& url)
m_tabWidget->openNewTab(url, QUrl());
}
void DolphinMainWindow::slotSplitViewChanged()
{
m_tabWidget->currentTabPage()->setSplitViewEnabled(GeneralSettings::splitView(), WithAnimation);
updateSplitAction();
}
void DolphinMainWindow::openInNewTab()
{
const KFileItemList& list = m_activeViewContainer->view()->selectedItems();
......@@ -2096,11 +2105,6 @@ void DolphinMainWindow::refreshViews()
m_tabWidget->refreshViews();
if (GeneralSettings::modifiedStartupSettings()) {
// The startup settings have been changed by the user (see bug #254947).
// Synchronize the split-view setting with the active view:
const bool splitView = GeneralSettings::splitView();
m_tabWidget->currentTabPage()->setSplitViewEnabled(splitView, WithAnimation);
updateSplitAction();
updateWindowTitle();
}
......
......@@ -171,6 +171,9 @@ public Q_SLOTS:
*/
void openNewTab(const QUrl& url);
/** @see GeneralSettings::splitViewChanged() */
void slotSplitViewChanged();
Q_SIGNALS:
/**
* Is sent if the selection of the currently active view has
......
......@@ -9,6 +9,7 @@
<include>KCompletion</include>
<kcfgfile name="dolphinrc"/>
<signal name="sortingChoiceChanged" />
<signal name="splitViewChanged" />
<group name="General">
<entry name="EditableUrl" type="Bool">
<label>Should the URL be editable for the user</label>
......@@ -49,6 +50,7 @@
<entry name="SplitView" type="Bool">
<label>Split the view into two panes</label>
<default>false</default>
<emit signal="splitViewChanged" />
</entry>
<entry name="FilterBar" type="Bool">
<label>Should the filter bar be shown</label>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment