From 8bf64cf8b15f390ab9a76f304dc22438b258556f Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Wed, 22 Sep 2021 20:52:52 +0200 Subject: Don't force icon for preferred search tool action if one is manually configured The code reads the icon from the relevant application and uses that for the action When the user has configured one manually in the toolbar settings that is overridden To avoid this only change the icon if it is the default one (search) BUG: 442815 (cherry picked from commit d3f427a6da1b117c85b1080bf198ae4758d00e8e) --- src/dolphinmainwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 961607d86..0d8438075 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1013,7 +1013,11 @@ void DolphinMainWindow::updateOpenPreferredSearchToolAction() if (tool) { openPreferredSearchTool->setVisible(true); openPreferredSearchTool->setText(i18nc("@action:inmenu Tools", "Open %1", tool->text())); - openPreferredSearchTool->setIcon(tool->icon()); + // Only override with the app icon if it is the default, i.e. the user hasn't configured one manually + // https://bugs.kde.org/show_bug.cgi?id=442815 + if (openPreferredSearchTool->icon().name() == QLatin1String("search")) { + openPreferredSearchTool->setIcon(tool->icon()); + } } else { openPreferredSearchTool->setVisible(false); // still visible in Shortcuts configuration window -- cgit v1.3 From fa8d9de4d866070acadd57178d20144bb5e62a0a Mon Sep 17 00:00:00 2001 From: Eugene Popov Date: Tue, 28 Sep 2021 19:39:52 +0000 Subject: 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 --- src/dolphinmainwindow.cpp | 14 +++++++++----- src/dolphinmainwindow.h | 3 +++ src/settings/dolphin_generalsettings.kcfg | 2 ++ 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'src/dolphinmainwindow.cpp') 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 + -- cgit v1.3