linking: remove redundant 'dont_move' parameter

The 'target.dont_move' property is only meant to be used with 'target.object'
metadata property, not smart filters metadata properties. This was probably
left accidentaly unused when designing a solution for #524 involving smart
filters.

Fixes #558
This commit is contained in:
Julian Bouzas
2024-01-19 13:29:02 -05:00
parent 6f3eb32937
commit caded6070d
2 changed files with 5 additions and 6 deletions

View File

@@ -106,11 +106,11 @@ local function getFilterSmartTargetable (metadata, node)
return false
end
local function getFilterSmartTarget (metadata, node, om, dont_move)
local function getFilterSmartTarget (metadata, node, om)
-- Check metadata and fallback to properties
local id = node["bound-id"]
local value_str = nil
if metadata ~= nil and not dont_move then
if metadata ~= nil then
value_str = metadata:find (id, "filter.smart.target")
end
if value_str == nil then

View File

@@ -11,7 +11,7 @@ cutils = require ("common-utils")
futils = require ("filter-utils")
log = Log.open_topic ("s-linking")
function findFilterTarget (si, om, dont_move)
function findFilterTarget (si, om)
local node = si:get_associated_proxy ("node")
local link_group = node.properties ["node.link-group"]
local target_id = -1
@@ -28,7 +28,7 @@ function findFilterTarget (si, om, dont_move)
end
-- get the filter target
return futils.get_filter_target (direction, link_group, dont_move), true
return futils.get_filter_target (direction, link_group), true
end
SimpleEventHook {
@@ -49,14 +49,13 @@ SimpleEventHook {
end
local dont_fallback = cutils.parseBool (si_props ["target.dont-fallback"])
local dont_move = cutils.parseBool (si_props ["target.dont-move"])
local target_picked = false
local allow_fallback
log:info (si, string.format ("handling item: %s (%s)",
tostring (si_props ["node.name"]), tostring (si_props ["node.id"])))
target, is_smart_filter = findFilterTarget (si, om, dont_move)
target, is_smart_filter = findFilterTarget (si, om)
local can_passthrough, passthrough_compatible
if target then