]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Fix closing a secondary viewContainer on startup settings change
[dolphin.git] / src / dolphinmainwindow.cpp
index 0d8438075eeaab889e2d19be3b686021de287efa..3966a08fe3221b558d1b7947178fae26ee39825a 100644 (file)
@@ -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();
     }