]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't force icon for preferred search tool action if one is manually configured
authorNicolas Fella <nicolas.fella@gmx.de>
Wed, 22 Sep 2021 18:52:52 +0000 (20:52 +0200)
committerNicolas Fella <nicolas.fella@gmx.de>
Wed, 22 Sep 2021 21:25:23 +0000 (23:25 +0200)
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

index 961607d867c84ec69f4a51bf76320fe66c3a0ef3..0d8438075eeaab889e2d19be3b686021de287efa 100644 (file)
@@ -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