Don't show the "Web Search" action in the media context menu

All this does is try to web search for the filename of the image, which
is useless. Let's hide it entirely in this case.
This commit is contained in:
Joshua Goins
2024-09-02 12:58:05 -04:00
parent aa116a35f5
commit 3af1a88e05
2 changed files with 9 additions and 0 deletions

View File

@@ -70,6 +70,11 @@ Loader {
*/
property list<Kirigami.Action> actions
/**
* @brief Whether the web search menu should be shown or not.
*/
property bool enableWebSearch: true
/**
* Some common actions shared between menus
*/
@@ -173,6 +178,7 @@ Loader {
id: webshortcutmenu
title: i18n("Search for '%1'", webshortcutmodel.trunkatedSearchText)
property bool isVisible: webshortcutmodel.enabled
property bool isVisible: webshortcutmodel.enabled && root.enableWebSearch
Component.onCompleted: {
webshortcutmenu.parent.visible = isVisible;
}

View File

@@ -32,6 +32,9 @@ DelegateContextMenu {
*/
required property var progressInfo
// Web search isn't useful for images
enableWebSearch: false
/**
* @brief The main list of menu item actions.
*