From: Eugene Popov Date: Tue, 28 Sep 2021 19:39:52 +0000 (+0000) Subject: Fix closing a secondary viewContainer on startup settings change X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/fa8d9de4d866070acadd57178d20144bb5e62a0a?hp=-c 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 --- fa8d9de4d866070acadd57178d20144bb5e62a0a diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 0d8438075..3966a08fe 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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(); } diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 3a29d1c0a..46515cc8b 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -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 diff --git a/src/settings/dolphin_generalsettings.kcfg b/src/settings/dolphin_generalsettings.kcfg index 728d11634..08f01d72c 100644 --- a/src/settings/dolphin_generalsettings.kcfg +++ b/src/settings/dolphin_generalsettings.kcfg @@ -9,6 +9,7 @@ KCompletion + @@ -49,6 +50,7 @@ false +