]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix closing a secondary viewContainer on startup settings change
authorEugene Popov <popov895@ukr.net>
Tue, 28 Sep 2021 19:39:52 +0000 (19:39 +0000)
committerNate Graham <nate@kde.org>
Tue, 28 Sep 2021 19:39:52 +0000 (19:39 +0000)
Apply split view settings only when changing the corresponding option.

BUG: 426221
FIXED-IN: 21.08.2

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/settings/dolphin_generalsettings.kcfg

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();
     }
 
index 3a29d1c0a483bef09e16e21e89c72032e43b00fc..46515cc8bee4000411f58e7b9fb70fbf5b286eb8 100644 (file)
@@ -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
index 728d1163460b5ac948df6ce3a25555204d0da754..08f01d72c974e96086c7e1155077273de0bb35b3 100644 (file)
@@ -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>